Skip to content

Commit

Permalink
Fix theming order
Browse files Browse the repository at this point in the history
  • Loading branch information
cbasje committed Jul 13, 2023
1 parent ae11124 commit 15edace
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 19 deletions.
6 changes: 3 additions & 3 deletions postcss.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ const config = {
postcssGlobalData({
files: ["./node_modules/open-props/media.min.css"],
}),
postcssCustomMedia,
postcssCustomMedia({ preserve: true }),
// postcssPresetEnv,
autoprefixer,
cssnano,
autoprefixer(),
cssnano(),
],
};

Expand Down
30 changes: 14 additions & 16 deletions src/styles/global.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
@import "open-props/media";

@layer normalize {
@import "open-props/normalize";
@import "open-props/zindex";
Expand All @@ -15,11 +13,7 @@
}
}

@layer theme {
@layer colors {
@import "open-props/colors";
}

@layer theming {
@layer sizes {
@import "open-props/borders";
@import "open-props/sizes";
Expand All @@ -29,6 +23,19 @@
@import "open-props/fonts";
@import "./fonts.scss";
}

@layer global {
@import "./themes/global.scss";
}

@layer themes {
@media (--OSlight) {
@import "./themes/light.scss";
}
@media (--OSdark) {
@import "./themes/dark.scss";
}
}
}

@layer components {
Expand All @@ -38,15 +45,6 @@
}

@layer overrides {
@import "./themes/global.scss";

@media (--OSlight) {
@import "./themes/light.scss";
}
@media (--OSdark) {
@import "./themes/dark.scss";
}

:root {
background-color: var(--theme-surface-1);
color: var(--theme-text-1);
Expand Down

0 comments on commit 15edace

Please sign in to comment.