Skip to content

Commit

Permalink
Fix cSS
Browse files Browse the repository at this point in the history
  • Loading branch information
enjikaka authored May 24, 2022
1 parent 3d792cd commit e7a9368
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions src/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,10 @@ export function stringToElements (string) {
* @returns {CSSStyleSheet}
*/
export function modernCSS (strings, ...rest) {
const text = Array.isArray(strings) ?
strings.reduce((acc, curr, i) => {
return acc + (rest[i] ? curr + rest[i] : curr);
}, '') :
strings;
const sheet = new CSSStyleSheet();

// @ts-ignore
sheet.replace(text);
sheet.replace(String.raw(...arguments));

return sheet;
}
Expand All @@ -72,15 +67,8 @@ export function stringToElements (string) {
* @returns {HTMLStyleElement}
*/
export function oldCSS (strings, ...rest) {
const text = Array.isArray(strings) ?
strings.reduce((acc, curr, i) => {
return acc + (rest[i] ? curr + rest[i] : curr);
}, '') :
strings;
const style = document.createElement('style');

style.innerText = text;

style.innerText = String.raw(...arguments);
return style;
}

Expand Down

0 comments on commit e7a9368

Please sign in to comment.