-
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?
Changes from 6 commits
38d8195
29c98a0
0932d06
efcfab4
6879967
1032528
4c8d436
d520258
ae61da3
746ca0f
8e31245
5841206
24e891c
ac34134
1e3aaa9
6b36702
03ace51
2dd86df
5efcf80
38fd91d
eab2599
11d9410
e0c7c69
72324ba
33cf259
82275d0
780ea47
91516d2
67cc4a5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,18 +23,14 @@ module.exports = { | |
none: "none", | ||
}, | ||
fontSize: { | ||
xs: "1.3rem", | ||
small: "1.6rem", | ||
smaller: "1.9rem", | ||
base: "2.0rem", | ||
title: "2.4rem", | ||
titlelarge: "2.7rem", | ||
lg: "3.6rem", | ||
xl: "3.8rem", | ||
48: "4.8rem", | ||
xxl: "6.5rem", | ||
"3xl": "9rem", | ||
brand: "2.6rem", | ||
xs: "0.875rem", | ||
small: "1rem", | ||
smaller: "1.25rem", | ||
base: "1.25rem", | ||
title: "1.5rem", | ||
titlelarge: "1.75rem", | ||
lg: "2.25rem", | ||
xxl: "3.25rem", | ||
}, | ||
screens: { | ||
xs: "320px", | ||
|
@@ -43,6 +39,26 @@ module.exports = { | |
md: "768px", | ||
lg: "1024px", | ||
}, | ||
spacing: { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||
0: "0rem", | ||
1: "0.1875rem", | ||
2: "0.3125rem", | ||
3: "0.5rem", | ||
4: "0.625rem", | ||
5: "0.75rem", | ||
6: "0.9375rem", | ||
8: "1.25rem", | ||
10: "1.5625rem", | ||
12: "1.875rem", | ||
16: "2.5rem", | ||
20: "3.125rem", | ||
24: "3.75rem", | ||
56: "8.75rem", | ||
gutter: "1.875rem", | ||
gutterHalf: "0.9375rem", | ||
gutterAndAHalf: "2.8125rem", | ||
doubleGutter: "3.75rem", | ||
}, | ||
colors: { | ||
red: { | ||
default: "#b10e1e", | ||
|
@@ -63,10 +79,12 @@ module.exports = { | |
lightblue: "#0154B0", | ||
slightlight: "#284162", | ||
/* trying to slowly implement a more consistent scale below */ | ||
300: "#71A7F3", | ||
500: "#4C8CE6", | ||
700: "#24508F", | ||
800: "#213045" /* Brand blue (default)*/, | ||
200: "#D7E5F5", | ||
500: "#004AB2", | ||
600: "#6584A6", | ||
700: "#425A76", | ||
800: "#31455C", | ||
900: "#26374A", | ||
}, | ||
gray: { | ||
default: "#eee", | ||
|
@@ -161,12 +179,6 @@ module.exports = { | |
white: "1px solid rgba(255, 255, 255, 0.1)", | ||
black: "1px solid black", | ||
}, | ||
spacing: { | ||
gutter: "3.0rem", | ||
gutterHalf: "1.5rem", | ||
gutterAndAHalf: "4.5rem", | ||
doubleGutter: "6.0rem", | ||
}, | ||
transitionDuration: { | ||
600: "600ms", | ||
}, | ||
|
@@ -177,11 +189,15 @@ module.exports = { | |
"5/8": "62.5%", | ||
}, | ||
maxWidth: { | ||
"4xl": "53rem", | ||
"80ch": "80ch", | ||
"2/3": "66.666667%", | ||
email: "600px", | ||
}, | ||
minWidth: { | ||
target: "45px", | ||
}, | ||
minHeight: { | ||
12: "1.875rem", | ||
target: "45px", | ||
}, | ||
flex: { | ||
|
@@ -217,6 +233,7 @@ module.exports = { | |
}), | ||
], | ||
variants: { | ||
backgroundColor: ["responsive", "hover", "focus"], | ||
borderWidth: ["responsive", "focus"], | ||
textColor: ["visited", "link", "hover", "focus"], | ||
}, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -178,8 +178,8 @@ def test_activity_page(mocker, client, stats, services): | |
response = client.get(url_for("main.activity")) | ||
page = BeautifulSoup(response.data.decode("utf-8"), "html.parser") | ||
assert response.status_code == 200 | ||
assert page.select("div[class~='lg:text-xxl']")[0].text == str(sum(x[2] for x in stats)) | ||
assert page.select("div[class~='lg:text-xxl']")[1].text == str(len(services)) | ||
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)) | ||
Comment on lines
+181
to
+182
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Love to see this instead of targetting css classes! |
||
|
||
|
||
@pytest.mark.parametrize( | ||
|
@@ -212,8 +212,8 @@ def test_home_page_displays_activity(mocker, client, stats, services): | |
response = client.get(url_for("main.index")) | ||
page = BeautifulSoup(response.data.decode("utf-8"), "html.parser") | ||
assert response.status_code == 200 | ||
assert page.select("span[class~='xs:text-lg']")[0].text == str(len(services)) | ||
assert page.select("span[class~='xs:text-lg']")[1].text == str(sum(x[2] for x in stats)) | ||
assert page.select("[data-test-id='count-services']")[0].text == str(len(services)) | ||
assert page.select("[data-test-id='count-notifications']")[0].text == str(sum(x[2] for x in stats)) | ||
|
||
|
||
@pytest.mark.parametrize( | ||
|
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.