-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tailwind 3 and Switch UI scaling from a base-10 to base-16 #1821
base: main
Are you sure you want to change the base?
Conversation
🧪 Review environmenthttps://5irdypu7g2c6cjajafjnjbbacu0lzpgv.lambda-url.ca-central-1.on.aws/ |
assert page.select("div[data-test-id='totals']")[0].text == str(sum(x[2] for x in stats)) | ||
assert page.select("div[data-test-id='services']")[0].text == str(len(services)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love to see this instead of targetting css classes!
@@ -15,6 +15,7 @@ import { faCircleQuestion } from "@fortawesome/free-solid-svg-icons/faCircleQues | |||
import { faTriangleExclamation } from "@fortawesome/free-solid-svg-icons/faTriangleExclamation"; | |||
import { faCircleExclamation } from "@fortawesome/free-solid-svg-icons/faCircleExclamation"; | |||
import { faInfoCircle } from "@fortawesome/free-solid-svg-icons"; | |||
import { faPaperPlane } from "@fortawesome/free-solid-svg-icons"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the scheduler updates
<div> | ||
<Calendar /> | ||
</div> | ||
<Calendar /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing this unclassed div helped make the scheduler responsive don to 320px
<p> | ||
<strong> | ||
<p className="confirmationTime"> | ||
<time datetime={date}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a <time>
element like in #1799
.Calendar-item:focus:not(.Calendar-item--day):not( | ||
.Calendar-item--unavailable | ||
):not(:empty) { | ||
outline: black inset; | ||
outline-offset: -4px; | ||
outline-offset: -4px; | ||
outline: var(--color-focus) 3px solid; | ||
} | ||
.Calendar-item:hover:not(.Calendar-item--day):not( | ||
.Calendar-item--unavailable | ||
):not(:empty) { | ||
background-color: var(--hover-color); | ||
color: white; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One is hover. Two is focus. always takes me some time to distinguish those two selectors.
gap: 4px; | ||
padding: 2px; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are designed to complement border widths, hence why I chose pixel instead of rem.
@@ -1,76 +1,81 @@ | |||
:root { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Github was hiding this file, but it contains quite a lot of manual changes.
In general:
- Update local CSS variables.
- Fix font sizes
- Increased target size of the calendar dates
- Map gutter and gutterHalf dimensions to the new CSS variables
- Removed an entire component that was unused (toggle/switch)
- Cleaned up Nav select and radios to match rest of Notify
- Updated the confirmation box. (see screenshots)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great!
Couple of notes on the scheduler:
- The enabled and disabled states of the month switch button are very hard to tell apart
- The outline of the active day button is a bit faint (this is subjective, feel free to ignore)
Good point! I just noticed. Lets make this clearer (Good timing to test this behaviour)
+1, I can make this one darker too. |
🧪 Review environmenthttps://zv2w6j3kxldlwbl5zago7chc7q0skebz.lambda-url.ca-central-1.on.aws/ |
🧪 Review environmenthttps://73eylxuftbkgk3yidjymzg3nzu0xovvh.lambda-url.ca-central-1.on.aws/ |
@@ -5,7 +5,7 @@ | |||
} | |||
|
|||
.big-number-number { | |||
@apply block .text-titlelarge pb-4 font-bold leading-none; | |||
@apply block text-titlelarge pb-4 font-bold leading-none; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just a typo we never caught until now. Tailwind 3 compiler caught this one
@@ -25,7 +25,7 @@ | |||
|
|||
.button:focus, | |||
a.button:focus { | |||
outline: 3px solid theme("colors.yellow.default"); | |||
outline: 3px solid theme("colors.yellow.DEFAULT"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor syntax tweaks. tailwind expects an all caps DEFAULT it seems.
@@ -15,7 +15,7 @@ | |||
.fullscreen-content th, | |||
.fullscreen-content .table-field-error-label, | |||
.fullscreen-content .table-field-left-aligned { | |||
@apply whitespace-no-wrap; | |||
@apply whitespace-nowrap; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
another typo caught by tailwind 3 compiler
margin-left: -1.5rem; | ||
margin-right: -1.5rem; | ||
@apply my-0; | ||
@apply my-0 -mx-gutterHalf; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here, I'm using our tokens, instead of using hard coded values.
@@ -148,11 +144,14 @@ section[id]:target { | |||
box-decoration-break: clone; | |||
} | |||
|
|||
.hidden, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tailwind reserves the hidden class. It does about the same thing.
.js-enabled .js-hidden { | ||
@apply hidden invisible; | ||
} | ||
|
||
@layer utilities { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I may have accidentally moved this up, but it addresses code on lines 204-209 below. From the migration guide: https://tailwindcss.com/docs/upgrade-guide#replace-variants-with-layer
@@ -347,15 +340,13 @@ label { | |||
@apply p-2 max-w-full; | |||
} | |||
|
|||
@screen smaller { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no "smaller" breakpoint. These styles could apply to the base viewport sizes.
@@ -43,34 +40,55 @@ module.exports = { | |||
md: "768px", | |||
lg: "1024px", | |||
}, | |||
spacing: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We want to theme the spacing, not extend base tailwind values. This means we move this into the theme section of the config
xs: "0.875rem", | ||
small: "1.0625rem", | ||
smaller: "1.25rem", | ||
base: "1.25rem", | ||
title: "1.5rem", | ||
titlelarge: "1.75rem", | ||
lg: "2.25rem", | ||
xxl: "3.25rem", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cleaned up unused tokens. Next we can think of making the keys make sense.
Summary | Résumé
Notify is currently setup so that 1rem = 10px at 100% scaling. By default, 1rem = 16px at 100% scaling.
This is not a problem for us now. However, when we tried to import some design system components in the past, we did hit this conflict in UI scaling. The DS uses the default 16px base.
In theory, this should help us be in a better place to slowly implement the design system if we choose to do so.
This PR:
Test instructions | Instructions pour tester la modification
Visual before and after of the size scale. Notice just some rounding for 2.5, 7.5 and 12.5