Skip to content

Commit

Permalink
style(3000): Align border radius to 6px in 3000 (#18866)
Browse files Browse the repository at this point in the history
* style: Align border radius to 6px in 3000

* Only affect .posthog-3000

* Also tune some non-4px radii

* Add radius comment

Co-authored-by: David Newell <[email protected]>

* Fix missing warehouse mocks and strictly prevent toasts

* Don't affect utility classes

---------

Co-authored-by: David Newell <[email protected]>
  • Loading branch information
Twixes and daibhin authored Nov 27, 2023
1 parent f95e3c1 commit 2bb1234
Show file tree
Hide file tree
Showing 24 changed files with 56 additions and 50 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@ debug.log
node_modules/
*.code-workspace
node_modules
frontend/.cache/
.mypy_cache
frontend/.cache/
frontend/dist/
# Paid font
frontend/public/Matter*.woff*
frontend/types/
frontend/__snapshots__/__diff_output__/
frontend/__snapshots__/__failures__/
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/layout.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
margin-bottom: -1px;
}
.form-signin-inputs input:first-child {
border-radius: 0.25rem 0.25rem 0 0;
border-radius: var(--radius) 0.25rem 0 0;
}
.form-signin input:last-child {
border-radius: 0 0 0.25rem 0.25rem;
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
margin-bottom: -1px;
}
.form-signin-inputs input:first-child {
border-radius: 0.25rem 0.25rem 0 0;
border-radius: var(--radius) 0.25rem 0 0;
}
.form-signin input:last-child {
border-radius: 0 0 0.25rem 0.25rem;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,13 @@
user-select: none;
background: var(--accent-3000);
border-width: 1px;
border-radius: 0.125rem;
border-radius: 0.25rem;

.posthog-3000 & {
padding: 0.125rem 0.25rem;
font-size: 0.625rem;
border-color: var(--secondary-3000-button-border-hover);
border-bottom-width: 2px;
border-radius: 0.25rem;
}

.KeyboardShortcut--muted > & {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@
color: var(--bg-light);
text-align: center;
background: var(--primary-3000);
border-radius: 0.25rem;
border-radius: var(--radius);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
line-height: 1.25rem;
background-color: var(--bg-light);
border: 1px solid var(--border);
border-radius: 0.25rem;
border-radius: var(--radius);

.LemonInput {
width: 3rem;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.SelectableElement {
border: 1px solid transparent;
border-radius: 4px;
border-radius: var(--radius);
transition: background-color 200ms ease, color 200ms ease, border 200ms ease;

&.SelectableElement--selected {
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/lib/lemon-ui/LemonButton/LemonButton3000.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
border-color: transparent;
border-style: solid;
border-width: var(--lemon-button-border-width);
border-radius: 6px;
border-radius: var(--radius);
outline: none;
transition: var(--transition);

Expand All @@ -35,7 +35,7 @@
border-color: transparent;
border-style: solid;
border-width: var(--lemon-button-border-width);
border-radius: 6px;
border-radius: var(--radius);
transition: var(--transition);

.LemonButton__icon {
Expand Down
6 changes: 5 additions & 1 deletion frontend/src/lib/lemon-ui/LemonCheckbox/LemonCheckbox.scss
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,13 @@
height: 1rem;
background: var(--bg-light);
border: 1.5px solid var(--border-bold);
border-radius: 3px; // Intentionally a bit smaller than --radius
border-radius: 0.1875rem; // Intentionally a bit smaller than --radius
transition: border 200ms ease, background 200ms ease;

&.posthog-3000 {
border-radius: 0.25rem; // Intentionally a bit smaller than --radius
}

path {
stroke: var(--bg-light);
stroke-dasharray: var(--tick-length);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
width: 700px;
padding: 0.5rem;
background-color: var(--side);
border-radius: 0.25rem;
border-radius: var(--radius);

@media (max-width: 960px) {
display: block;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
.property-group {
padding: 0.5rem;
background-color: var(--side);
border-radius: 4px;
border-radius: var(--radius);

.posthog-3000 & {
border-width: 1px;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
padding-top: 1rem;
margin: 0.5rem 0;
border: 1px solid var(--border);
border-radius: 4px;
border-radius: var(--radius);

&.CohortCriteriaGroups__matching-group--error {
border: 1px solid var(--danger);
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/scenes/cohorts/Cohorts.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
margin-top: 1rem;
background-color: transparent !important;
border: 2px dashed var(--primary) !important;
border-radius: 4px !important;
border-radius: var(--radius) !important;

&:hover {
border-color: var(--primary-3000-hover) !important;
Expand Down
8 changes: 4 additions & 4 deletions frontend/src/scenes/experiments/Experiment.scss
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
font-weight: 500;
color: #fff;
letter-spacing: 0.01em;
border-radius: 4px;
border-radius: var(--radius);
}
}

Expand Down Expand Up @@ -150,10 +150,10 @@
}

.ant-progress-inner {
border-radius: 4px;
border-radius: var(--radius);

.ant-progress-bg {
border-radius: 4px;
border-radius: var(--radius);
}
}
}
Expand Down Expand Up @@ -203,5 +203,5 @@
padding: 8px 8px 8px 16px;
margin-left: 0.5rem;
border: 1px solid var(--border);
border-radius: 4px;
border-radius: var(--radius);
}
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ $glyph_height: 23px; // Based on .funnel-step-glyph
height: 32px;
margin: 4px 0;
background-color: var(--funnel-background);
border-radius: 4px;
border-radius: var(--radius);

.funnel-bar {
position: relative;
Expand All @@ -124,15 +124,15 @@ $glyph_height: 23px; // Based on .funnel-step-glyph
transition: width 0.2s ease, height 0.2s ease;

&.first {
border-radius: 4px 0 0 4px;
border-radius: var(--radius) 0 0 4px;
}

&.last {
border-radius: 0 4px 4px 0;
}

&.only {
border-radius: 4px;
border-radius: var(--radius);
}

.funnel-bar-percentage {
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/scenes/retention/RetentionTable.scss
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
margin: 2px;
text-align: right;
background-color: var(--retention-table-color); // NOTE: This is usually overridden in JS
border-radius: 0.25rem;
border-radius: var(--radius);
transition: transform 200ms ease-out;

&:hover {
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/scenes/saved-insights/SavedInsights.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
cursor: pointer;
background-color: var(--primary-3000);
border: 1px solid var(--border);
border-radius: 4px;
border-radius: var(--radius);
}

.saved-insight-empty-state {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@
white-space: nowrap;
visibility: hidden;
background-color: var(--tick-color);
border-radius: 0.25rem;
border-radius: var(--radius);
opacity: 0;
transition: opacity 150ms ease-in-out;
transform: translateX(-50%);
Expand Down
8 changes: 4 additions & 4 deletions frontend/src/scenes/surveys/SurveyAppearance.scss
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
font-size: 14px;
color: black;
background: white;
border-radius: 6px;
border-radius: var(--radius);
outline: none;
}

Expand All @@ -54,7 +54,7 @@
cursor: pointer;
user-select: none;
border: 1.5px solid transparent;
border-radius: 6px;
border-radius: var(--radius);
outline: 0;
box-shadow: 0 2px 0 rgb(0 0 0 / 4.5%);
}
Expand Down Expand Up @@ -141,7 +141,7 @@
.rating-options-buttons {
display: grid;
overflow: hidden;
border-radius: 6px;
border-radius: var(--radius);
}

.rating-options-buttons > .ratings-number {
Expand Down Expand Up @@ -241,7 +241,7 @@
cursor: pointer;
background: white;
border: 1.5px solid rgb(0 0 0 / 25%);
border-radius: 4px;
border-radius: var(--radius);
}

.multiple-choice-options .choice-option-open label {
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/styles/global.scss
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,7 @@ body {

::-webkit-scrollbar-thumb {
background: var(--trace-3000);
border-radius: 0.25rem;
border-radius: var(--radius);

&:hover {
background: var(--muted-3000);
Expand Down
30 changes: 15 additions & 15 deletions frontend/src/styles/utilities.scss
Original file line number Diff line number Diff line change
Expand Up @@ -1008,27 +1008,27 @@ $decorations: underline, overline, line-through, no-underline;
}

.rounded {
border-radius: var(--radius); /* 4px */
border-radius: 0.25rem;
}

.rounded-l {
border-top-left-radius: var(--radius); /* 4px */
border-bottom-left-radius: var(--radius); /* 4px */
border-top-left-radius: 0.25rem;
border-bottom-left-radius: 0.25rem;
}

.rounded-r {
border-top-right-radius: var(--radius); /* 4px */
border-bottom-right-radius: var(--radius); /* 4px */
border-top-right-radius: 0.25rem;
border-bottom-right-radius: 0.25rem;
}

.rounded-t {
border-top-left-radius: var(--radius); /* 4px */
border-top-right-radius: var(--radius); /* 4px */
border-top-left-radius: 0.25rem;
border-top-right-radius: 0.25rem;
}

.rounded-b {
border-bottom-right-radius: var(--radius); /* 4px */
border-bottom-left-radius: var(--radius); /* 4px */
border-bottom-right-radius: 0.25rem;
border-bottom-left-radius: 0.25rem;
}

.rounded-none {
Expand All @@ -1050,27 +1050,27 @@ $decorations: underline, overline, line-through, no-underline;
}

.rounded-md {
border-radius: calc(var(--radius) * 1.5); /* 6px */
border-radius: 0.375rem;
}

.rounded-lg {
border-radius: calc(var(--radius) * 2); /* 8px */
border-radius: 0.5rem;
}

.rounded-xl {
border-radius: calc(var(--radius) * 3); /* 12px */
border-radius: 0.75rem;
}

.rounded-2xl {
border-radius: calc(var(--radius) * 4); /* 16px */
border-radius: 1rem;
}

.rounded-3xl {
border-radius: calc(var(--radius) * 6); /* 24px */
border-radius: 1.5rem;
}

.rounded-4xl {
border-radius: calc(var(--radius) * 8); /* 32px */
border-radius: 2rem;
}

.rounded-full {
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/styles/vars.scss
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ $_lifecycle_dormant: $_danger;
--bg-bridge: #ebece8;

// Non-color vars
--radius: 4px;
--radius: 0.25rem;
--shadow-elevation: 0px 16px 16px -16px rgb(0 0 0 / 35%);
--opacity-disabled: 0.6;
--font-medium: 500;
Expand Down Expand Up @@ -469,4 +469,5 @@ $_lifecycle_dormant: $_danger;
--primary-alt-highlight: var(--primary-alt-highlight-3000);
--data-color-1: #1d4aff;
--data-color-10: #35416b;
--radius: 0.375rem;
}
2 changes: 1 addition & 1 deletion frontend/src/toolbar/bar/Toolbar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

::-webkit-scrollbar-thumb {
background: var(--trace-3000);
border-radius: 0.25rem;
border-radius: var(--radius);

&:hover {
background: var(--muted-3000);
Expand Down
6 changes: 3 additions & 3 deletions posthog/templates/email/styles.html
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
font-size: 18px;
font-weight: 600;
border: none;
border-radius: 4px;
border-radius: var(--radius);
}

.button {
Expand All @@ -127,11 +127,11 @@
padding-bottom: 16px;
padding-left: 48px;
padding-right: 48px;
border-radius: 4px;
border-radius: var(--radius);
background-color: #1d4aff;
font-weight: 500;
color: #fff;
border-radius: 4px;
border-radius: var(--radius);
text-decoration: none;
}

Expand Down

0 comments on commit 2bb1234

Please sign in to comment.