loading up the forgejo repo on tangled to test page performance
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

enable tailwind nesting (#29746)

Currently, if you implement native CSS nesting within a Vue component a
warning will appear in the terminal. It states
`Nested CSS was detected, but CSS nesting has not been configured
correctly.
Please enable a CSS nesting plugin *before* Tailwind in your
configuration.` To fix this error we need to enable the built-in
[tailwinds nesting
config](https://tailwindcss.com/docs/using-with-preprocessors#nesting).

Example code to trigger the warning within a vue component:

```CSS
<style>
.example {
&:hover,
&:focus-visible {
color: var(--color-text);
}

& svg {
margin-right: 0.78rem;
}
}
</style>
```

---------

Co-authored-by: rafh <rafaelheard@gmail.com>
Co-authored-by: silverwind <me@silverwind.io>
(cherry picked from commit 03753cbc0ff68cc4eee0a65b556e6d86a8f1c63f)

authored by

Rafael Heard
rafh
silverwind
and committed by
Earl Warren
989dc10c 9d08d00d

+56 -2
+48 -1
package-lock.json
··· 43 43 "pdfobject": "2.3.0", 44 44 "postcss": "8.4.35", 45 45 "postcss-loader": "8.1.1", 46 + "postcss-nesting": "12.1.0", 46 47 "pretty-ms": "9.0.0", 47 48 "sortablejs": "1.15.2", 48 49 "swagger-ui-dist": "5.11.8", ··· 528 529 "@csstools/css-tokenizer": "^2.2.3" 529 530 } 530 531 }, 532 + "node_modules/@csstools/selector-resolve-nested": { 533 + "version": "1.1.0", 534 + "resolved": "https://registry.npmjs.org/@csstools/selector-resolve-nested/-/selector-resolve-nested-1.1.0.tgz", 535 + "integrity": "sha512-uWvSaeRcHyeNenKg8tp17EVDRkpflmdyvbE0DHo6D/GdBb6PDnCYYU6gRpXhtICMGMcahQmj2zGxwFM/WC8hCg==", 536 + "funding": [ 537 + { 538 + "type": "github", 539 + "url": "https://github.com/sponsors/csstools" 540 + }, 541 + { 542 + "type": "opencollective", 543 + "url": "https://opencollective.com/csstools" 544 + } 545 + ], 546 + "engines": { 547 + "node": "^14 || ^16 || >=18" 548 + }, 549 + "peerDependencies": { 550 + "postcss-selector-parser": "^6.0.13" 551 + } 552 + }, 531 553 "node_modules/@csstools/selector-specificity": { 532 554 "version": "3.0.2", 533 555 "resolved": "https://registry.npmjs.org/@csstools/selector-specificity/-/selector-specificity-3.0.2.tgz", 534 556 "integrity": "sha512-RpHaZ1h9LE7aALeQXmXrJkRG84ZxIsctEN2biEUmFyKpzFM3zZ35eUMcIzZFsw/2olQE6v69+esEqU2f1MKycg==", 535 - "dev": true, 536 557 "funding": [ 537 558 { 538 559 "type": "github", ··· 9814 9835 }, 9815 9836 "peerDependencies": { 9816 9837 "postcss": "^8.2.14" 9838 + } 9839 + }, 9840 + "node_modules/postcss-nesting": { 9841 + "version": "12.1.0", 9842 + "resolved": "https://registry.npmjs.org/postcss-nesting/-/postcss-nesting-12.1.0.tgz", 9843 + "integrity": "sha512-QOYnosaZ+mlP6plQrAxFw09UUp2Sgtxj1BVHN+rSVbtV0Yx48zRt9/9F/ZOoxOKBBEsaJk2MYhhVRjeRRw5yuw==", 9844 + "funding": [ 9845 + { 9846 + "type": "github", 9847 + "url": "https://github.com/sponsors/csstools" 9848 + }, 9849 + { 9850 + "type": "opencollective", 9851 + "url": "https://opencollective.com/csstools" 9852 + } 9853 + ], 9854 + "dependencies": { 9855 + "@csstools/selector-resolve-nested": "^1.1.0", 9856 + "@csstools/selector-specificity": "^3.0.2", 9857 + "postcss-selector-parser": "^6.0.13" 9858 + }, 9859 + "engines": { 9860 + "node": "^14 || ^16 || >=18" 9861 + }, 9862 + "peerDependencies": { 9863 + "postcss": "^8.4" 9817 9864 } 9818 9865 }, 9819 9866 "node_modules/postcss-resolve-nested-selector": {
+1
package.json
··· 42 42 "pdfobject": "2.3.0", 43 43 "postcss": "8.4.35", 44 44 "postcss-loader": "8.1.1", 45 + "postcss-nesting": "12.1.0", 45 46 "pretty-ms": "9.0.0", 46 47 "sortablejs": "1.15.2", 47 48 "swagger-ui-dist": "5.11.8",
+7 -1
webpack.config.js
··· 13 13 import {env} from 'node:process'; 14 14 import tailwindcss from 'tailwindcss'; 15 15 import tailwindConfig from './tailwind.config.js'; 16 + import tailwindcssNesting from 'tailwindcss/nesting/index.js'; 17 + import postcssNesting from 'postcss-nesting'; 16 18 17 19 const {EsbuildPlugin} = EsBuildLoader; 18 20 const {SourceMapDevToolPlugin, DefinePlugin} = webpack; ··· 149 151 sourceMap: sourceMaps === 'true', 150 152 url: {filter: filterCssImport}, 151 153 import: {filter: filterCssImport}, 154 + importLoaders: 1, 152 155 }, 153 156 }, 154 157 { ··· 156 159 options: { 157 160 postcssOptions: { 158 161 map: false, // https://github.com/postcss/postcss/issues/1914 159 - plugins: [tailwindcss(tailwindConfig)], 162 + plugins: [ 163 + tailwindcssNesting(postcssNesting({edition: '2024-02'})), 164 + tailwindcss(tailwindConfig), 165 + ], 160 166 }, 161 167 }, 162 168 }