Skip to content
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
update tests
  • Loading branch information
RobinMalfait committed Nov 6, 2024
commit 9ecfcb08c60d541000c8935e6efa77647821b552
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,7 @@ exports[`\`@import 'tailwindcss'\` is replaced with the generated CSS 1`] = `
color: inherit;
-webkit-text-decoration: inherit;
-webkit-text-decoration: inherit;
-webkit-text-decoration: inherit;
text-decoration: inherit;
}

Expand Down
36 changes: 2 additions & 34 deletions packages/tailwindcss/src/compat/plugin-api.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1592,11 +1592,7 @@ describe('addVariant', () => {
.potato\\:flex:large-potato {
display: flex;
}
}
}

@media (width <= 400px) {
@supports (font: bold) {
.potato\\:underline:large-potato {
text-decoration-line: underline;
}
Expand Down Expand Up @@ -1840,19 +1836,7 @@ describe('matchVariant', () => {

expect(optimizeCss(compiled).trim()).toMatchInlineSnapshot(`
"@layer utilities {
.alphabet-d\\:underline[data-order="1"] {
text-decoration-line: underline;
}

.alphabet-a\\:underline[data-order="2"] {
text-decoration-line: underline;
}

.alphabet-c\\:underline[data-order="3"] {
text-decoration-line: underline;
}

.alphabet-b\\:underline[data-order="4"] {
.alphabet-d\\:underline[data-order="1"], .alphabet-a\\:underline[data-order="2"], .alphabet-c\\:underline[data-order="3"], .alphabet-b\\:underline[data-order="4"] {
text-decoration-line: underline;
}
}"
Expand Down Expand Up @@ -2059,9 +2043,7 @@ describe('matchVariant', () => {
order: 3;
}
}
}

@media (width >= 100px) {
@media (width <= 300px) {
.testmin-\\[100px\\]\\:testmax-\\[300px\\]\\:order-4 {
order: 4;
Expand Down Expand Up @@ -2116,11 +2098,7 @@ describe('matchVariant', () => {
text-decoration-line: underline;
}
}
}
}

@media (width >= 100px) {
@media (width <= 200px) {
.testmin-\\[100px\\]\\:testmax-\\[200px\\]\\:focus\\:underline:focus {
text-decoration-line: underline;
}
Expand Down Expand Up @@ -2245,9 +2223,7 @@ describe('matchVariant', () => {
text-decoration-line: underline;
}
}
}

@media (width <= 400px) {
@media (width >= 200px) {
.testmax-\\[400px\\]\\:testmin-\\[200px\\]\\:underline {
text-decoration-line: underline;
Expand All @@ -2261,9 +2237,7 @@ describe('matchVariant', () => {
text-decoration-line: underline;
}
}
}

@media (width <= 300px) {
@media (width >= 200px) {
.testmax-\\[300px\\]\\:testmin-\\[200px\\]\\:underline {
text-decoration-line: underline;
Expand Down Expand Up @@ -2870,11 +2844,7 @@ describe('addUtilities()', () => {

expect(optimizeCss(compiled.build(['form-input', 'lg:form-textarea'])).trim())
.toMatchInlineSnapshot(`
".form-input {
background-color: red;
}

.form-input::placeholder {
".form-input, .form-input::placeholder {
background-color: red;
}

Expand Down Expand Up @@ -3610,9 +3580,7 @@ describe('matchUtilities()', () => {
--foo: 12px;
display: flex;
}
}

@media (width >= 1024px) {
.lg\\:foo-bar {
--foo: bar;
display: flex;
Expand Down
76 changes: 10 additions & 66 deletions packages/tailwindcss/src/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -511,9 +511,7 @@ describe('variant stacking', () => {
.before\\:hover\\:flex:before:hover {
display: flex;
}
}

@media (hover: hover) {
.hover\\:before\\:flex:hover:before {
content: var(--tw-content);
display: flex;
Expand Down Expand Up @@ -914,32 +912,14 @@ describe('sorting', () => {
.peer-hover\\:flex:is(:where(.peer):hover ~ *) {
display: flex;
}
}

@media (hover: hover) {
@media (hover: hover) {
.group-hover\\:peer-hover\\:flex:is(:where(.group):hover *):is(:where(.peer):hover ~ *) {
.group-hover\\:peer-hover\\:flex:is(:where(.group):hover *):is(:where(.peer):hover ~ *), .peer-hover\\:group-hover\\:flex:is(:where(.peer):hover ~ *):is(:where(.group):hover *) {
display: flex;
}
}
}

@media (hover: hover) {
@media (hover: hover) {
.peer-hover\\:group-hover\\:flex:is(:where(.peer):hover ~ *):is(:where(.group):hover *) {
display: flex;
}
}
}

@media (hover: hover) {
.group-focus\\:peer-hover\\:flex:is(:where(.group):focus *):is(:where(.peer):hover ~ *) {
display: flex;
}
}

@media (hover: hover) {
.peer-hover\\:group-focus\\:flex:is(:where(.peer):hover ~ *):is(:where(.group):focus *) {
.group-focus\\:peer-hover\\:flex:is(:where(.group):focus *):is(:where(.peer):hover ~ *), .peer-hover\\:group-focus\\:flex:is(:where(.peer):hover ~ *):is(:where(.group):focus *) {
display: flex;
}
}
Expand All @@ -949,22 +929,12 @@ describe('sorting', () => {
}

@media (hover: hover) {
.group-hover\\:peer-focus\\:flex:is(:where(.group):hover *):is(:where(.peer):focus ~ *) {
display: flex;
}
}

@media (hover: hover) {
.peer-focus\\:group-hover\\:flex:is(:where(.peer):focus ~ *):is(:where(.group):hover *) {
.group-hover\\:peer-focus\\:flex:is(:where(.group):hover *):is(:where(.peer):focus ~ *), .peer-focus\\:group-hover\\:flex:is(:where(.peer):focus ~ *):is(:where(.group):hover *) {
display: flex;
}
}

.group-focus\\:peer-focus\\:flex:is(:where(.group):focus *):is(:where(.peer):focus ~ *) {
display: flex;
}

.peer-focus\\:group-focus\\:flex:is(:where(.peer):focus ~ *):is(:where(.group):focus *) {
.group-focus\\:peer-focus\\:flex:is(:where(.group):focus *):is(:where(.peer):focus ~ *), .peer-focus\\:group-focus\\:flex:is(:where(.peer):focus ~ *):is(:where(.group):focus *) {
display: flex;
}

Expand Down Expand Up @@ -2198,11 +2168,7 @@ describe('plugins', () => {

expect(optimizeCss(compiled).trim()).toMatchInlineSnapshot(`
"@layer utilities {
.rtl\\:flex:where(:dir(rtl), [dir="rtl"], [dir="rtl"] *) {
display: flex;
}

.dark\\:flex:is([data-theme="dark"] *) {
.rtl\\:flex:where(:dir(rtl), [dir="rtl"], [dir="rtl"] *), .dark\\:flex:is([data-theme="dark"] *) {
display: flex;
}

Expand Down Expand Up @@ -2386,11 +2352,7 @@ describe('@variant', () => {

expect(optimizeCss(compiled).trim()).toMatchInlineSnapshot(`
"@layer utilities {
.group-selected\\:underline:is(:where(.group)[data-selected] *) {
text-decoration-line: underline;
}

.selected\\:underline[data-selected] {
.group-selected\\:underline:is(:where(.group)[data-selected] *), .selected\\:underline[data-selected] {
text-decoration-line: underline;
}
}"
Expand All @@ -2414,11 +2376,7 @@ describe('@variant', () => {

expect(optimizeCss(compiled).trim()).toMatchInlineSnapshot(`
"@layer utilities {
.group-hocus\\:underline:is(:is(:where(.group):hover, :where(.group):focus) *) {
text-decoration-line: underline;
}

.hocus\\:underline:hover, .hocus\\:underline:focus {
.group-hocus\\:underline:is(:is(:where(.group):hover, :where(.group):focus) *), .hocus\\:underline:hover, .hocus\\:underline:focus {
text-decoration-line: underline;
}
}"
Expand All @@ -2445,11 +2403,7 @@ describe('@variant', () => {

expect(optimizeCss(compiled).trim()).toMatchInlineSnapshot(`
"@layer utilities {
.group-hocus\\:underline:is(:where(.group):hover *), .group-hocus\\:underline:is(:where(.group):focus *) {
text-decoration-line: underline;
}

.hocus\\:underline:hover, .hocus\\:underline:focus {
.group-hocus\\:underline:is(:where(.group):hover *), .group-hocus\\:underline:is(:where(.group):focus *), .hocus\\:underline:hover, .hocus\\:underline:focus {
text-decoration-line: underline;
}
}"
Expand Down Expand Up @@ -2583,13 +2537,7 @@ describe('@variant', () => {
expect(optimizeCss(compiled).trim()).toMatchInlineSnapshot(`
"@layer utilities {
@media (hover: hover) {
.group-hocus\\:underline:is(:where(.group):hover *) {
text-decoration-line: underline;
}
}

@media (hover: hover) {
.hocus\\:underline:hover {
.group-hocus\\:underline:is(:where(.group):hover *), .hocus\\:underline:hover {
text-decoration-line: underline;
}
}
Expand Down Expand Up @@ -2745,11 +2693,7 @@ describe('@variant', () => {
),
).toMatchInlineSnapshot(`
"@layer utilities {
.rtl\\:flex:where(:dir(rtl), [dir="rtl"], [dir="rtl"] *) {
display: flex;
}

.dark\\:flex:is([data-theme="dark"] *) {
.rtl\\:flex:where(:dir(rtl), [dir="rtl"], [dir="rtl"] *), .dark\\:flex:is([data-theme="dark"] *) {
display: flex;
}

Expand Down
Loading