Skip to content

Commit

Permalink
CSS/JS interoperability with postcss-preset-env
Browse files Browse the repository at this point in the history
  • Loading branch information
alexdilley committed Jun 21, 2019
1 parent 899e8a8 commit 1d4e0b2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions postcss.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ module.exports = {
require('postcss-import'),
require('tailwindcss'),
require('postcss-preset-env')({
importFrom: ['./src/styles/variables.js'],
features: {
'color-mod-function': true,
},
Expand Down
2 changes: 1 addition & 1 deletion src/components/Nav.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<style>
nav {
border-color: color-mod(theme('colors.red.500') a(0.1));
border-color: color-mod(var(--theme) a(0.1));
}
li {
Expand Down
5 changes: 5 additions & 0 deletions src/styles/variables.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
customProperties: {
'--theme': '#ff3e00',
},
};

0 comments on commit 1d4e0b2

Please sign in to comment.