Skip to content

Commit

Permalink
feat: update parsing css
Browse files Browse the repository at this point in the history
  • Loading branch information
DESKTOP-939248N\apple committed May 19, 2021
1 parent 374391b commit 01ef735
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import './CoCreate-scroll.css'
// import crud from '@cocreate/crud-client'

const mediaRangeNames = ["xs", "sm", "md", "lg", "xl"];

const themes = ["light", "dark"];
const ranges = {
xs: [0, 575],
sm: [576, 768],
Expand Down Expand Up @@ -128,9 +128,10 @@ const makeRuleForTheme = (className) => {
let style, value, theme;
[style, value, theme] = className.split(':');
if (theme == 'dark' || theme == 'light') {
let rule = '[theme="' + theme + '"] .' + style + '\\:' + value + '\\:' + theme + ' {' + style + ':' + value + ';}'
let rule = '[theme="' + theme + '"] .' + style + '\\:' + value + '\\:' + theme + ' {' + style + ':' + value + ';}';
let reverseRule = ':not([theme="' + themes[1 - themes.indexOf(theme)] + '"] .' + style + '\\:' + value + '\\:' + theme + ' {' + style + ':' + value + ';}';
tempStyleList.push(rule);
themeCSS[theme].push(rule);
themeCSS[theme].push(reverseRule);
return rule;
}
}
Expand Down

0 comments on commit 01ef735

Please sign in to comment.