1 unstable release
0.0.1 | Apr 10, 2023 |
---|
#12 in #class-name
97KB
2.5K
SLoC
XISS
Experimental compiler for modular CSS written in Rust.
Supported ID types
- Class names
- Vars
- Keyframes
Global IDs
- Minification
- Performance
Class Maps
- Inline
- Table
- Auto
Declaring states
@classmap buttonClass {
disabled: ButtonDisabled;
focus: ButtonFocus Focus;
}
Declaring static class names with @static
@classmap buttonClass {
@static Button;
disabled: ButtonDisabled;
}
Excluding states with exclude constraints @exclude
@classmap buttonClass {
@static Button;
disabled: ButtonDisabled;
focus: ButtonFocus;
@exclude disabled focus;
}
External IDs
@extern class Button from 'xiss/buttons';
@extern class Button as myButton from 'xiss/buttons';
Constants
:const {
--MAIN-BACKGROUND: #333;
}
Exclude filters
CSS Map Files
Format
CSS Map files are stored in a CSV format with four columns:
- ID kind
C
- Class nameV
- VarK
- Keyframes
- Module ID
- Local ID
- Global ID
E.g.
C,xiss/example,Button,a
V,xiss/example,MyVar,a
K,xiss/example,anim,a
C,xiss/test,Slider,b
C,xiss/test,SliderDisabled,c
C,xiss/test,SliderActive,d
Lock File
Defining static IDs
Reserve short IDs for frequently used IDs
Dependencies
~22–33MB
~546K SLoC