Skip to content

Commit

Permalink
fix: parsing classNames
Browse files Browse the repository at this point in the history
  • Loading branch information
DESKTOP-939248N\apple committed May 19, 2021
1 parent 403db83 commit a153fdf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/test.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ <h1 class="color:white:dark color:yellow:light">hello how are you</h1>
<a data-toggle="dark, light" data-toggle_target="[theme]" data-toggle_attribute="theme">Toggle Darkmode</a>
</div>

<div class="display:flex flex-wrap:wrap align-items:center flex-direction:row-reverse" className="test"></div>
<div class="display:flex flex-wrap:wrap align-items:center flex-direction:row-reverse" className="test">hehehe</div>
<div class="test"></div>
<div class="test"></div>

Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ const getParsedCss = () => {
const parseCSSForClassNames = () => {
let elements = document.querySelectorAll("[className]");
for (let ele of elements) {
let rule = "." + ele.getAttribute("className") + "{" + ele.getAttribute("class") + "}";
let rule = "." + ele.getAttribute("className") + "{" + ele.getAttribute("class").replace(/ /g, ";") + "}";
tempStyleList.push(rule);
}
}
Expand Down

0 comments on commit a153fdf

Please sign in to comment.