Skip to content

CSS utility using SASS & SCSS

Notifications You must be signed in to change notification settings

VQH-cmd/sassolith

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Sassolith

Sassolith

  • πŸ“¦ Toolkit: Sassolith
  • πŸ—οΈ Version: 2.0.0
  • πŸ‘¨β€πŸ’» Author: VQH-cmd



[01]: Description

  • CSS utility using SASS & SCSS.
  • Customize CSS classes with your own style.



[02]: Quick Start




[03]: Import


// style.sass
@import "<LOCATION_NAME>/_theme"
@import "<LOCATION_NAME>/_misc"
@import "<LOCATION_NAME>/_breakpoint"

@import "@vqh-cmd/sassolith"
// style.scss
@import "<LOCATION_NAME>/_theme";
@import "<LOCATION_NAME>/_misc";
@import "<LOCATION_NAME>/_breakpoint";

@import "@vqh-cmd/sassolith";

πŸ—ƒοΈ Global Files:


If using node-sass-json-importer

// style.sass
@import "<LOCATION_NAME>/theme.json"
@import "<LOCATION_NAME>/misc.json"
@import "<LOCATION_NAME>/breakpoint.json"

@import "@vqh-cmd/sassolith"
// style.scss
@import "<LOCATION_NAME>/theme.json";
@import "<LOCATION_NAME>/misc.json";
@import "<LOCATION_NAME>/breakpoint.json";

@import "@vqh-cmd/sassolith";

πŸ—ƒοΈ Global Files:




[04]: Global Files


theme


misc


breakpoint




[05]: Config


Basic

@include Sassolith((
	"class": (
		box-border,
		box-content,
	),
	"style": box-sizing,
	"value": (
		border-box,
		content-box,
	),
	"data": (
		"active": true,
		"important": false,
		"responsive": true,
		"state": (
			":required",
			":active",
			":hover",
			":visited",
		),
	),
));


Color

@include Sassolith((
	"class": co,
	"style": color,
	"value": false,
	"data": (
		"active": true,
		"important": false,
		"responsive": true,
		"isColor": true,
		"state": (
			":hover",
		),
	),
));


Formula

@include Sassolith((
	"class": w,
	"style": width,
	"value": false,
	"data": (
		"active": true,
		"important": false,
		"responsive": true,
		"formula": (
			"unit": (
				"class": "vw",
				"value": "vw",
			),
			"ratio": calc(1/10),
			"min": 0,
			"max": 1000,
			"step": 50,
		),
		"state": (
			":hover",
		),
	),
));


Font Face

@include SassolithFont((
	"family": "Roboto",
	"name": "font1",
	"weight": (100, 200, 300, 400, 500, 600, 700, 800, 900),
	"style": (normal, italic),
	"src": "../fonts/",
	"format": (ttf, otf),
));





[06]: Utility Function & Mixin


Get $name from theme.

  • theme Β» default Β» category Β» color
  • theme Β» default Β» category Β» gradient

co($name)

// πŸ“Ÿ scss
.co-m1 {color: co(m1);}

// πŸ‘‰ output
.co-m1 {color: #0EF7D0;}

coTint($name, $percent)

// πŸ“Ÿ scss
.co-m1-t80 {color: coTint(m1, 80);}

// πŸ‘‰ output
.co-m1-t80 {color: #cffdf6;}

coShade($name, $percent)

// πŸ“Ÿ scss
.co-m1-t80 {color: coShade(m1, 80);}

// πŸ‘‰ output
.co-m1-t80 {color: #03312a;}

gra($name)

// πŸ“Ÿ scss
.grad-gra1 {background-color: gra(gra1);}

// πŸ‘‰ output
.grad-gra1 {background-color: linear-gradient(90deg, #0EF7D0 0%, #6f9 100%);}

Get $media from breakpoint.

res($media)

// πŸ“Ÿ scss
.fs-main {
	font-size: 24px;
	@include res(sm) {font-size: 20px;}
	@include res(xs) {font-size: 16px;}
}

// πŸ‘‰ output
.fs-main {font-size: 24px;}
@media screen and (max-width: 800px) {
	.fs-main {font-size: 20px;}
}
@media screen and (max-width: 600px) {
	.fs-main {font-size: 18px;}
}



Copyright Β© 2023, VQH-cmd.