Microsass is a script that can convert the basic structures of SCSS into CSS directly in the browser.
Microsass can process the staggered selectors of SCSS, and supports the declaration and use of basic variables, as well as the basic arithmetic processing of variables.
It also interprets the properties to add the -webkit, -moz-, -o and -ms required.
Testing and live example
https://bonarja.github.io/microsass 🔨⛏
Support
Microsass supports sass staggered selectors, the use of & (self selector), @media screen, @keyframes and @font-face.
Microsass allows to create variables using $size1: 300px
; and basic arithmetic processes (addition, subtraction, multiplication and division)
.item
NOTE Microsass still can not interpret @media screen inside another 🙁
USE
Autoload
Microsass
For multiple load you can separate using commas
Autoload by Promise
Load by javaScript
Convert SCSS text
Convert micro sass string to css minify string
var scss = ` $w1: 400px; $w2: 200px; #app { background: orange; .item{ width: $w1 + $w2; p { color: white; } } }`;var css = microsass;
Convert micro sass string to css with format, html format and colors
var scss = ` $w1: 400px; $w2: 200px; #app { background: orange; .item{ width: $w1 + $w2; p { color: white; } } }`;var css = microsass;
Convert by NPM module
npm install microsass -save
const microsass = ; var css = microsass;
Media abbreviation:
An abbreviation has been created for the media screen
Use:
Compiled output:
{}
Cases:
@if x >= xx ----> @media screen and (min-width xx)
@if x <= xx ----> @media screen and (max-width xx)
@if y >= xx ----> @media screen and (min-height xx)
@if y <= xx ----> @media screen and (max-height xx)