forked from laptou/astro
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: pass Astro config postcss to Svelte preprocess (withastro#3685)
* fix: pass Astro config postcss to Svelte preprocess * test: preset env for nested styles * chore: changeset
- Loading branch information
1 parent
cec8c0d
commit 3b9b3b6
Showing
9 changed files
with
43 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,12 @@ | ||
const postcssPresetEnv = require('postcss-preset-env') | ||
const autoPrefixer = require('autoprefixer') | ||
|
||
module.exports = { | ||
plugins: { | ||
autoprefixer: { | ||
plugins: [ | ||
// included to ensure public/ CSS resources are NOT transformed | ||
autoPrefixer({ | ||
overrideBrowserslist: ['> 0.1%', 'IE 11'] // enforce `appearance: none;` is prefixed with -webkit and -moz | ||
} | ||
} | ||
}; | ||
}), | ||
postcssPresetEnv({ features: { 'nesting-rules': true } }), | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
<style> | ||
.astro-component { | ||
appearance: none; | ||
&.nested { | ||
color: red; | ||
} | ||
} | ||
</style> | ||
|
||
<div class="astro-component"> | ||
Astro | ||
<div class="astro-component nested"> | ||
Astro | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
.solid { | ||
appearance: none; | ||
&.nested { | ||
color: red; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
<style> | ||
.svelte { | ||
appearance: none; | ||
&.nested { | ||
color: red; | ||
} | ||
} | ||
</style> | ||
|
||
<div class="svelte"> | ||
Svelte | ||
<div class="svelte nested"> | ||
Svelte | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,14 @@ | ||
<style> | ||
.vue { | ||
appearance: none; | ||
&.nested { | ||
color: red; | ||
} | ||
} | ||
</style> | ||
|
||
<template> | ||
<div class="vue"> | ||
Vue | ||
<div class="vue nested"> | ||
Vue | ||
</div> | ||
</template> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters