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

fix(bundler): allow CSS nesting by default, restore postcss-preset-env #10680

Merged
merged 3 commits into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion packages/docusaurus-bundler/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
"@docusaurus/logger": "3.6.1",
"@docusaurus/types": "3.6.1",
"@docusaurus/utils": "3.6.1",
"autoprefixer": "^10.4.14",
"babel-loader": "^9.2.1",
"clean-css": "^5.3.2",
"copy-webpack-plugin": "^11.0.0",
Expand All @@ -37,6 +36,7 @@
"null-loader": "^4.0.1",
"postcss": "^8.4.26",
"postcss-loader": "^7.3.3",
"postcss-preset-env": "^10.1.0",
"react-dev-utils": "^12.0.1",
"terser-webpack-plugin": "^5.3.9",
"tslib": "^2.6.0",
Expand Down
9 changes: 7 additions & 2 deletions packages/docusaurus-bundler/src/loaders/styleLoader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,13 @@ export async function createStyleLoadersFactory({
// https://github.com/facebook/create-react-app/issues/2677
ident: 'postcss',
plugins: [
// eslint-disable-next-line global-require
require('autoprefixer'),
[
require.resolve('postcss-preset-env'),
{
// Keeping this empty options object on purpose
// It could be more convenient for configurePostCss() usage
},
],
],
},
},
Expand Down
40 changes: 25 additions & 15 deletions website/_dogfooding/dogfooding.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,36 @@
* LICENSE file in the root directory of this source tree.
*/

html.plugin-docs.plugin-id-docs-tests .red > a {
color: red;
}
html {
@media screen and (min-width: 1px) {
&.plugin-docs.plugin-id-docs-tests {
.red > a {
color: red;
}

html.plugin-docs.plugin-id-docs-tests .navbar {
border-bottom: solid thin cyan;
}
.navbar {
border-bottom: solid thin cyan;
}
}

html.plugin-blog.plugin-id-blog-tests .navbar {
border-bottom: solid thin lime;
}
&.plugin-blog.plugin-id-blog-tests {
.navbar {
border-bottom: solid thin lime;
}
}

html.plugin-pages.plugin-id-pages-tests .navbar {
border-bottom: solid thin yellow;
&.plugin-pages.plugin-id-pages-tests {
.navbar {
border-bottom: solid thin yellow;
}
}

&:has(#navbar-dropdown-tests) .navbar__item.dropdown ~ a {
display: none;
}
}
}

#z-index-test {
z-index: 100;
}

html:has(#navbar-dropdown-tests) .navbar__item.dropdown ~ a {
display: none;
}
Loading
Loading