Skip to content
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

refactor: Upgrade to tailwind version 3 #3700

Merged
merged 31 commits into from Dec 21, 2021
Merged
Show file tree
Hide file tree
Changes from 26 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
00d6ba6
tailwind 3 work
driskull Dec 10, 2021
634fde6
WIP
driskull Dec 10, 2021
9a2a139
cleanup
driskull Dec 13, 2021
cb98925
WIP
driskull Dec 14, 2021
7aca12c
Merge branch 'master' into dris0000/tailwind-3
driskull Dec 14, 2021
b06e2b1
cleanup
driskull Dec 14, 2021
2c33f4f
get things running
driskull Dec 15, 2021
b00d9c6
cleanup
driskull Dec 15, 2021
5852bd6
test compressed to remove comments?
driskull Dec 15, 2021
b480f70
revert
driskull Dec 15, 2021
0d9a369
Merge branch 'master' into dris0000/tailwind-3
driskull Dec 15, 2021
1221063
cssnano test
driskull Dec 15, 2021
c41087b
lite preset
driskull Dec 15, 2021
4078bd8
font size test
driskull Dec 15, 2021
2775f11
revert
driskull Dec 15, 2021
73ce082
fix test
driskull Dec 15, 2021
d25d5b2
bump
driskull Dec 15, 2021
6f93297
Merge branch 'master' into dris0000/tailwind-3
driskull Dec 16, 2021
a078a17
bump and revert changes
driskull Dec 16, 2021
5b2ce32
bump
driskull Dec 17, 2021
eb6737c
revert class name changes.
driskull Dec 20, 2021
d3a7a2c
use "n" instead of "-" for config fontSize values.
driskull Dec 20, 2021
f46cd35
Merge branch 'master' into dris0000/tailwind-3
driskull Dec 20, 2021
f9723d5
fix class
driskull Dec 20, 2021
2d0ed78
remove cssnano
driskull Dec 20, 2021
dc4bdc8
cleanup fraction values.
driskull Dec 20, 2021
b0ab948
cleanup typing config
driskull Dec 21, 2021
5cd165b
Merge branch 'master' into dris0000/tailwind-3
driskull Dec 21, 2021
f955a93
cleanup config
driskull Dec 21, 2021
9ae5641
Merge branch 'master' into dris0000/tailwind-3
driskull Dec 21, 2021
4dab5c2
Merge branch 'master' into dris0000/tailwind-3
driskull Dec 21, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1,471 changes: 309 additions & 1,162 deletions package-lock.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions package.json
Expand Up @@ -19,7 +19,7 @@
"build": "npm run util:copy-icons && stencil build",
"build:watch": "npm run util:copy-icons && stencil build --watch",
"build:watch-dev": "npm run util:copy-icons && stencil build --dev --watch",
"deps:update": "updtr --exclude chalk typescript tailwindcss @types/jest jest jest-cli puppeteer && git add package*.json && git commit -q -m \"build(deps): bump versions\"",
"deps:update": "updtr --exclude chalk typescript @types/jest jest jest-cli puppeteer && git add package*.json && git commit -q -m \"build(deps): bump versions\"",
"docs": "concurrently --kill-others --raw \"npm:util:build-docs && build-storybook --static-dir ./__docs-temp__ --output-dir ./docs\" \"ts-node ./support/cleanOnProcessExit.ts --path ./__docs-temp__\"",
"docs:preview": "concurrently --raw \"npm:util:build-docs && start-storybook --static-dir ./__docs-temp__\" \"ts-node ./support/cleanOnProcessExit.ts --path ./__docs-temp__\"",
"lint": "concurrently npm:lint:*",
Expand Down Expand Up @@ -99,7 +99,7 @@
"@typescript-eslint/eslint-plugin": "5.7.0",
"@typescript-eslint/parser": "5.7.0",
"@whitespace/storybook-addon-html": "5.0.0",
"autoprefixer": "10.3.7",
"autoprefixer": "10.4.0",
"axe-core": "4.3.5",
"babel-loader": "8.2.3",
"chalk": "4.1.2",
Expand Down Expand Up @@ -139,7 +139,7 @@
"storybook-rtl-addon": "0.3.3",
"stylelint": "14.1.0",
"stylelint-config-recommended-scss": "5.0.2",
"tailwindcss": "1.9.6",
"tailwindcss": "3.0.7",
"ts-jest": "27.1.1",
"ts-node": "10.4.0",
"typescript": "4.2.4",
Expand Down
2 changes: 1 addition & 1 deletion src/assets/styles/_header.scss
Expand Up @@ -30,5 +30,5 @@ h3.heading {
}
h4.heading,
h5.heading {
@apply text--1h;
@apply text-n1h;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tailwindlabs/tailwindcss#6599

classes that start with a dash were not working. They would either not be applied or cause a build error.

I changed all of them to be n2h instead of -2h.

tailwindlabs/tailwindcss#6599

}
@@ -1,6 +1,6 @@
%icon-position {
/* icon rotation variables */
--calcite-accordion-item-icon-rotation: theme("rotate.-90");
--calcite-accordion-item-icon-rotation: calc(theme("rotate.90") * -1);
--calcite-accordion-item-active-icon-rotation: theme("rotate.0");
--calcite-accordion-item-icon-rotation-rtl: theme("rotate.90");
--calcite-accordion-item-active-icon-rotation-rtl: theme("rotate.0");
Expand All @@ -25,7 +25,7 @@
--calcite-accordion-item-icon-rotation: theme("rotate.0");
--calcite-accordion-item-active-icon-rotation: theme("rotate.180");
--calcite-accordion-item-icon-rotation-rtl: theme("rotate.0");
--calcite-accordion-item-active-icon-rotation-rtl: theme("rotate.-180");
--calcite-accordion-item-active-icon-rotation-rtl: calc(theme("rotate.180") * -1);
}

:host {
Expand Down
4 changes: 2 additions & 2 deletions src/components/calcite-accordion/calcite-accordion.scss
Expand Up @@ -3,14 +3,14 @@
--calcite-accordion-item-spacing-unit: theme("spacing.1");
--calcite-accordion-icon-margin: theme("spacing.2");
--calcite-accordion-item-padding: var(--calcite-accordion-item-spacing-unit) theme("spacing.2");
@apply text--2h;
@apply text-n2h;
}

:host([scale="m"]) {
--calcite-accordion-item-spacing-unit: theme("spacing.2");
--calcite-accordion-icon-margin: theme("spacing.3");
--calcite-accordion-item-padding: var(--calcite-accordion-item-spacing-unit) theme("spacing.3");
@apply text--1h;
@apply text-n1h;
}

:host([scale="l"]) {
Expand Down
Expand Up @@ -33,5 +33,5 @@
}

.menu {
@apply flex-col flex-no-wrap outline-none;
@apply flex-col flex-nowrap outline-none;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

}
2 changes: 1 addition & 1 deletion src/components/calcite-action-pad/calcite-action-pad.scss
Expand Up @@ -39,7 +39,7 @@
::slotted(calcite-action-group) {
@apply border-0
p-0;
border-inline-end-width: theme("borderWidth.default");
border-inline-end-width: theme("borderWidth.DEFAULT");
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

}
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/components/calcite-action/calcite-action.scss
Expand Up @@ -18,7 +18,7 @@
justify-start
m-0
relative
text--2h
text-n2h
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

classes that start with a dash were not working. They would either not be applied or cause a build error.

I changed all of them to be n2h instead of -2h.

tailwindlabs/tailwindcss#6599

font-medium
text-color-3
w-auto;
Expand Down Expand Up @@ -66,7 +66,7 @@

:host([scale="s"]) {
.button {
@apply font-normal p-2 text--2h;
@apply font-normal p-2 text-n2h;
}
.button--text-visible .icon-container {
margin-inline-end: theme("spacing.2");
Expand All @@ -75,7 +75,7 @@

:host([scale="m"]) {
.button {
@apply font-normal p-4 text--1h;
@apply font-normal p-4 text-n1h;
}
.button--text-visible .icon-container {
margin-inline-end: theme("spacing.3");
Expand Down
12 changes: 6 additions & 6 deletions src/components/calcite-alert/calcite-alert.scss
Expand Up @@ -12,13 +12,13 @@
--calcite-alert-spacing-token-small: theme("spacing.2");
--calcite-alert-spacing-token-large: theme("spacing.3");
@include slotted("title", "*") {
@apply text--1-wrap;
@apply text-n1-wrap;
}
@include slotted("message", "*") {
@apply text--2-wrap;
@apply text-n2-wrap;
}
@include slotted("link", "*") {
@apply text--2-wrap;
@apply text-n2-wrap;
}
.alert-queue-count {
@apply mx-2;
Expand All @@ -40,10 +40,10 @@
@apply text-0-wrap;
}
@include slotted("message", "*") {
@apply text--1-wrap;
@apply text-n1-wrap;
}
@include slotted("link", "*") {
@apply text--1-wrap;
@apply text-n1-wrap;
}
.alert-queue-count {
@apply mx-3;
Expand Down Expand Up @@ -140,7 +140,7 @@
@apply inline
m-0
font-normal
text--1-wrap
text-n1-wrap
text-color-2;
margin-inline-end: theme("margin.2");
}
Expand Down
4 changes: 2 additions & 2 deletions src/components/calcite-avatar/calcite-avatar.scss
Expand Up @@ -3,11 +3,11 @@
}

:host([scale="s"]) {
@apply w-6 h-6 text--3;
@apply w-6 h-6 text-n3;
}

:host([scale="m"]) {
@apply w-8 h-8 text--2;
@apply w-8 h-8 text-n2;
}

:host([scale="l"]) {
Expand Down
Expand Up @@ -2,7 +2,7 @@
@apply box-border
bg-foreground-1
text-color-2
text--1
text-n1
block;
}

Expand Down Expand Up @@ -36,7 +36,7 @@
px-0
py-2
select-none
text--1
text-n1
focus-base;

&:focus {
Expand Down
6 changes: 3 additions & 3 deletions src/components/calcite-block/calcite-block.scss
Expand Up @@ -38,7 +38,7 @@

.toggle {
@apply flex
flex-no-wrap
flex-nowrap
justify-between
font-inherit
items-center
Expand Down Expand Up @@ -74,7 +74,7 @@ calcite-handle {

.header .title .heading {
@apply p-0
text--1
text-n1
text-color-2
font-medium
word-break
Expand All @@ -86,7 +86,7 @@ calcite-handle {

.summary {
@apply p-0
text--2
text-n2
text-color-3
mt-0.5
word-break;
Expand Down
8 changes: 4 additions & 4 deletions src/components/calcite-button/calcite-button.scss
Expand Up @@ -507,13 +507,13 @@
:host([appearance="outline"][split-child="primary"]) button,
:host([appearance="clear"][split-child="primary"]) button {
border-inline-end-width: 0;
border-inline-start-width: theme("borderWidth.default");
border-inline-start-width: theme("borderWidth.DEFAULT");
}

:host([appearance="outline"][split-child="secondary"]) button,
:host([appearance="clear"][split-child="secondary"]) button {
border-inline-start-width: 0;
border-inline-end-width: theme("borderWidth.default");
border-inline-end-width: theme("borderWidth.DEFAULT");
}

// transparent
Expand Down Expand Up @@ -623,7 +623,7 @@
// generate button scales (scenario: text exists)
:host([scale="s"]) button.content--slotted,
:host([scale="s"]) a.content--slotted {
@apply text--2h;
@apply text-n2h;
}
// accommodate for transparent buttons not having borders
:host([scale="s"][appearance="transparent"]) button.content--slotted,
Expand All @@ -634,7 +634,7 @@
:host([scale="m"]) button.content--slotted,
:host([scale="m"]) a.content--slotted {
--calcite-button-padding-x: 11px;
@apply text--1h;
@apply text-n1h;
}
:host([scale="m"]:not([appearance="transparent"])) button.content--slotted,
:host([scale="m"]:not([appearance="transparent"])) a.content--slotted {
Expand Down
10 changes: 5 additions & 5 deletions src/components/calcite-card/calcite-card.scss
Expand Up @@ -60,7 +60,7 @@
.card-content {
@apply p-3
text-color-3
text--2-wrap;
text-n2-wrap;
}

// selectable and selected styles
Expand All @@ -77,27 +77,27 @@
@apply font-medium
text-color-1
m-0
text--1-wrap;
text-n1-wrap;
}

@include slotted("subtitle", "*") {
@apply font-normal
text-color-2
m-0
mt-2
text--2-wrap;
text-n2-wrap;
}

@include slotted("thumbnail", "img") {
@apply max-w-full min-w-full;
}

@include slotted("footer-leading", "*") {
@apply self-center text--2-wrap;
@apply self-center text-n2-wrap;
margin-inline-end: auto;
}
@include slotted("footer-trailing", "*") {
@apply self-center text--2-wrap;
@apply self-center text-n2-wrap;
}

.thumbnail-wrapper {
Expand Down
2 changes: 1 addition & 1 deletion src/components/calcite-checkbox/calcite-checkbox.scss
Expand Up @@ -10,7 +10,7 @@
--calcite-checkbox-size: theme("spacing.3");
}
:host([scale="m"]) {
--calcite-checkbox-size: theme("fontSize.-1");
--calcite-checkbox-size: theme("fontSize.n1");
}
:host([scale="l"]) {
--calcite-checkbox-size: theme("spacing.4");
Expand Down
4 changes: 2 additions & 2 deletions src/components/calcite-chip/calcite-chip.scss
@@ -1,15 +1,15 @@
// scale
// todo update when new spacing modifiers are introduced to calcite-base
:host([scale="s"]) {
@apply h-6 text--2;
@apply h-6 text-n2;
--calcite-chip-spacing-unit-l: theme("spacing.2");
--calcite-chip-spacing-unit-s: theme("spacing.1");
.chip-image-container {
@apply h-5 w-5;
}
}
:host([scale="m"]) {
@apply h-8 text--1;
@apply h-8 text-n1;
--calcite-chip-spacing-unit-l: theme("spacing.3");
--calcite-chip-spacing-unit-s: 6px;
.chip-image-container {
Expand Down
8 changes: 4 additions & 4 deletions src/components/calcite-color-picker/calcite-color-picker.scss
Expand Up @@ -5,7 +5,7 @@ $gap--small: 4px;
$gap--large: 12px;

:host {
@apply inline-block text--2h font-normal;
@apply inline-block text-n2h font-normal;
}

:host([scale="s"]) {
Expand Down Expand Up @@ -44,7 +44,7 @@ $gap--large: 12px;
}

:host([scale="l"]) {
@apply text--1h;
@apply text-n1h;

.container {
width: 464px;
Expand All @@ -69,7 +69,7 @@ $gap--large: 12px;
}

.control-section {
@apply flex-no-wrap items-baseline;
@apply flex-nowrap items-baseline;

> :nth-child(2) {
margin-inline-start: $gap--large;
Expand Down Expand Up @@ -107,7 +107,7 @@ $gap--large: 12px;
}

.scope {
@apply text--1
@apply text-n1
p-0
mb-0
mr-0
Expand Down
@@ -1,13 +1,13 @@
.scale--s {
@apply text--2h;
@apply text-n2h;
--calcite-combobox-item-spacing-unit-l: theme("spacing.2");
--calcite-combobox-item-spacing-unit-s: theme("spacing.1");
--calcite-combobox-item-spacing-indent-1: theme("spacing.2");
--calcite-combobox-item-spacing-indent-2: theme("spacing.4");
}

.scale--m {
@apply text--1h;
@apply text-n1h;
--calcite-combobox-item-spacing-unit-l: theme("spacing.3");
--calcite-combobox-item-spacing-unit-s: theme("spacing.2");
--calcite-combobox-item-spacing-indent-1: theme("spacing.3");
Expand Down
@@ -1,12 +1,12 @@
.scale--s {
@apply text--2h;
@apply text-n2h;
--calcite-combobox-item-spacing-unit-l: theme("spacing.2");
--calcite-combobox-item-spacing-unit-s: theme("spacing.1");
--calcite-combobox-item-spacing-indent: theme("spacing.2");
}

.scale--m {
@apply text--1h;
@apply text-n1h;
--calcite-combobox-item-spacing-unit-l: theme("spacing.3");
--calcite-combobox-item-spacing-unit-s: theme("spacing.2");
--calcite-combobox-item-spacing-indent: theme("spacing.3");
Expand Down