Skip to content

Commit

Permalink
fix: parsing issue
Browse files Browse the repository at this point in the history
  • Loading branch information
DESKTOP-939248N\apple committed May 19, 2021
1 parent f159ad0 commit 1162d67
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
8 changes: 7 additions & 1 deletion docs/test.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,14 @@
<div class="width:50%@300px-500px">
<div class="background:black:dark">
<h1 class="color:white:dark">hello how are you</h1>
<div class="width:50%@300px-500px">
<div class="background:black:dark background:blue:light">
<h1 class="color:white:dark color:yellow:light">hello how are you</h1>
</div>
<a data-toggle="dark, light" data-toggle_target="[theme]" data-toggle_attribute="theme">Toggle Darkmode</a>
</div>
</div>
<a data-toggle="dark, light" data-toggle_target="body" data-toggle_attribute="theme">Toggle Darkmode</a>
<a data-toggle="dark, light" data-toggle_target="[theme]" data-toggle_attribute="theme">Toggle Darkmode</a>
</div>

<nav class="nav display:flex align-items:center background:whitesmoke padding-top:10px padding-bottom:10px" data-main_content_id="content" data-scroll="sticky-nav,hide-nav" data-scroll_up="10" data-scroll_down="10" data-collection="components" data-document_id="60395ef42b3ac232657040fd"
Expand Down
5 changes: 3 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,6 @@ const addParsingClassList = (classList) => {
let re = /.+:.+/;
let re_theme = /.+:.+:.+/;
let hasChanged = false;

for (let classname of classList) {
if (re_theme.exec(classname)) {
makeRuleForTheme(classname)
Expand Down Expand Up @@ -325,15 +324,17 @@ const parseCSSForTheme = () => {
initial += c + "\n";
}
initial += "}";
tempStyleList.push(initial);
}
if (themeCSS.light.length) {
initial = "@media (prefers-color-scheme: light) {"
for (let c of themeCSS.light) {
initial += c + "\n";
}
initial += "}";
tempStyleList.push(initial);
}
tempStyleList.push(initial);

}

const parseClass = (classname) => {
Expand Down

0 comments on commit 1162d67

Please sign in to comment.