How to Import FSCSS from javascript in HTML
Import FSCSS from javascript file In my javascript file I do something like this: //fscss.js async function styleWith(){ let fscss = await import("https://wbf.tiiny.site/newFscss.js"); :root .box{ $rgb: %3([200,]); $bg-color: #00F0F0; } newFscss = (` .box{ %2( Width, Height[: 100px;]) Border: 4px solid $rgb!; } $(@keyframes box, .box &[ 3s linear infinite alternate]) { 0%{ Transform: rotateX(0); } 100%{ Transform: rotateX(360deg); }} fscss.exec(newFscss).use; } styleWith(); Index.html: FSCSS tutorials Follow Figured Shorthand Cascading Style Sheet
Import FSCSS from javascript file
In my javascript file I do something like this:
//fscss.js
async function styleWith(){
let fscss = await import("https://wbf.tiiny.site/newFscss.js");
:root .box{
$rgb: %3([200,]);
$bg-color: #00F0F0;
}
newFscss = (`
.box{
%2(
Width,
Height[: 100px;])
Border: 4px solid $rgb!;
}
$(@keyframes box, .box &[ 3s linear infinite alternate]) {
0%{
Transform: rotateX(0);
}
100%{
Transform: rotateX(360deg);
}}
fscss.exec(newFscss).use;
}
styleWith();
Index.html: