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

Change how we handle defaults (optimized or not) #6926

Merged
merged 22 commits into from
Jan 7, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
WIP
  • Loading branch information
thecrypticace committed Jan 5, 2022
commit a39a6dc077a2603951c69c1be5ee054b6460db78
13 changes: 2 additions & 11 deletions tests/apply.test.css
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
.complex-utilities {
--tw-ordinal: ordinal;
--tw-numeric-spacing: tabular-nums;
font-variant-numeric: var(--tw-font-variant-numeric);
font-variant-numeric: var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction);
--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color),
0 4px 6px -4px var(--tw-shadow-color);
Expand All @@ -142,7 +142,7 @@
}
.complex-utilities:focus {
--tw-numeric-fraction: diagonal-fractions;
font-variant-numeric: var(--tw-font-variant-numeric);
font-variant-numeric: var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction);
}
.basic-nesting-parent {
.basic-nesting-child {
Expand Down Expand Up @@ -314,15 +314,6 @@ h2 {
.important-modifier-variant:hover {
border-radius: 0.375rem !important;
}
.complex-utilities {
--tw-ordinal: ;
--tw-slashed-zero: ;
--tw-numeric-figure: ;
--tw-numeric-spacing: ;
--tw-numeric-fraction: ;
--tw-font-variant-numeric: var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure)
var(--tw-numeric-spacing) var(--tw-numeric-fraction);
}
@keyframes spin {
to {
transform: rotate(360deg);
Expand Down
37 changes: 37 additions & 0 deletions tests/apply.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -824,6 +824,7 @@ it('apply can emit defaults in isolated environments without @tailwind directive
}
`

// TODO: Do we want this to work?
return run(input, config).then((result) => {
return expect(result.css).toMatchFormattedCss(css`
.foo {
Expand Down Expand Up @@ -873,6 +874,42 @@ it('apply does not emit defaults in isolated environments without optimizeUniver
--tw-skew-y: 0;
--tw-scale-x: 1;
--tw-scale-y: 1;
--tw-pan-x: ;
--tw-pan-y: ;
--tw-pinch-zoom: ;
--tw-scroll-snap-strictness: proximity;
border-color: #e5e7eb;
--tw-ordinal: ;
--tw-slashed-zero: ;
--tw-numeric-figure: ;
--tw-numeric-spacing: ;
--tw-numeric-fraction: ;
--tw-ring-inset: ;
--tw-ring-offset-width: 0px;
--tw-ring-offset-color: #fff;
--tw-ring-color: rgb(59 130 246 / 0.5);
--tw-ring-offset-shadow: 0 0 #0000;
--tw-ring-shadow: 0 0 #0000;
--tw-shadow: 0 0 #0000;
--tw-shadow-colored: 0 0 #0000;
--tw-blur: ;
--tw-brightness: ;
--tw-contrast: ;
--tw-grayscale: ;
--tw-hue-rotate: ;
--tw-invert: ;
--tw-saturate: ;
--tw-sepia: ;
--tw-drop-shadow: ;
--tw-backdrop-blur: ;
--tw-backdrop-brightness: ;
--tw-backdrop-contrast: ;
--tw-backdrop-grayscale: ;
--tw-backdrop-hue-rotate: ;
--tw-backdrop-invert: ;
--tw-backdrop-opacity: ;
--tw-backdrop-saturate: ;
--tw-backdrop-sepia: ;
}
.foo:focus {
--tw-rotate: 90deg;
Expand Down
6 changes: 3 additions & 3 deletions tests/basic-usage.test.css
Original file line number Diff line number Diff line change
Expand Up @@ -775,15 +775,15 @@
}
.ordinal {
--tw-ordinal: ordinal;
font-variant-numeric: var(--tw-font-variant-numeric);
font-variant-numeric: var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction);
}
.tabular-nums {
--tw-numeric-spacing: tabular-nums;
font-variant-numeric: var(--tw-font-variant-numeric);
font-variant-numeric: var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction);
}
.diagonal-fractions {
--tw-numeric-fraction: diagonal-fractions;
font-variant-numeric: var(--tw-font-variant-numeric);
font-variant-numeric: var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction);
}
.leading-relaxed {
line-height: 1.625;
Expand Down
4 changes: 2 additions & 2 deletions tests/kitchen-sink.test.css
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ div {
.test-apply-font-variant {
--tw-ordinal: ordinal;
--tw-numeric-spacing: tabular-nums;
font-variant-numeric: var(--tw-font-variant-numeric);
font-variant-numeric: var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction);
}
.custom-component {
background: #123456;
Expand Down Expand Up @@ -429,7 +429,7 @@ div {
}
.sm\:tabular-nums {
--tw-numeric-spacing: tabular-nums;
font-variant-numeric: var(--tw-font-variant-numeric);
font-variant-numeric: var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction);
}
.sm\:custom-util {
background: #abcdef;
Expand Down
6 changes: 3 additions & 3 deletions tests/raw-content.test.css
Original file line number Diff line number Diff line change
Expand Up @@ -525,15 +525,15 @@
}
.ordinal {
--tw-ordinal: ordinal;
font-variant-numeric: var(--tw-font-variant-numeric);
font-variant-numeric: var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction);
}
.tabular-nums {
--tw-numeric-spacing: tabular-nums;
font-variant-numeric: var(--tw-font-variant-numeric);
font-variant-numeric: var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction);
}
.diagonal-fractions {
--tw-numeric-fraction: diagonal-fractions;
font-variant-numeric: var(--tw-font-variant-numeric);
font-variant-numeric: var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction);
}
.leading-relaxed {
line-height: 1.625;
Expand Down