Warning
With version 2.0, the library installation has undergone changes. For more information, visit the Installation section
A CSS framework that enables you to easily organize the style of a web page.
The library has been modularized for use in JavaScript as well.
<script defer src="https://rawcdn.githack.com/sanalzio/-LUSS-/master/luss.js" type="module"></script>
<style> tag in the following format and write the code inside it:
<style luss>
/* Codes */
</style>
<link rel="luss" href="./style.luss">
$text-color: #f2f2f2
$bg-color: black
body{
color: $text-color;
background: $bg-color;
}
img {
width: $[1em + 2px];
}
body{
padding: random(1, 3)rem;
}
p::after{
content: "date(day):date(month):date(year)";
}
article::after{
content: "date()";
}
$color-scheme: light
@if ("$color-scheme"=="light")
p{
color: black;
}
end
Warning
Each condition statement must be followed by "end" or "###" to avoid including other operations in the condition. And if using a string in a condition, enclose it in double quotes ("").
$color-scheme: light
@if ("$color-scheme"=="light")
p{
color: black;
}
@else
p{
color: white;
}
end
p::after{
content: "@js{(new Date().getMinutes()).toString()}"
}
$color-scheme: light
p{
color: ("$color-scheme" == "light" ? "black" : "white");
}
Usage: (<condition> ? <if condition true reutrn this> : <else return this>)
p{
color: gs$ #div1 (color);
}
body {
color: $randomColor;
}
body {
color: #rgb(255, 0, 0);
}
$tags: h1:hover | p
each($tags {
color: orange;
})
each(p:hover | a:active {
color: red;
})
interval(body $1000 {
color: $randomColor;
})
a::inner{
content: "<p>Hello</p>";
color: $randomColor;
}
a::outer{
content: "<body><p>Hello</p></body>";
color: $randomColor;
}
a::after{
content: "lower(HELLO) upper(world)";
}
Escapes the string within the quotation marks.
a::after{
content: "e('Hello World')";
}
It adds the 'luss' style to the page.
import { luss } from "https://rawcdn.githack.com/sanalzio/-LUSS-/master/luss.js"
luss(`
$success: green
body{
color: $success;
}
`);
It compiles the specified 'luss' code and returns the compiled CSS code.
import { lussmain } from "https://rawcdn.githack.com/sanalzio/-LUSS-/master/luss.js"
console.log(lussmain(`
$success: green
body{
color: $success;
}
`));