Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Let HSL stay HSL in SCSS.

License

NotificationsYou must be signed in to change notification settings

meduzen/true-hsl.scss

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HSL colorsare awesome. Unfortunately, undernode-sass theSASShsl() andhsla() functions converts to other formats (hex or RGB/RGBA). And the situationisn’t better in Dart SASS.

hsl.scss overwrites SASShsl andhsla with passthrough functions, preserving HSL(A) color declarations without transformation nor validation.

Installation

npm install hsl.scss -D pulls the package into your project.

  • In anode-sass project,@import 'hsl.scss'; in a SCSS files makehsl() andhsla() available.
  • In a Dart SASS project,@use 'hsl.scss' as * is required in every SCSS files wherehsl() orhsla() are used.

Usage

You can now expecthsl andhsla to behave like they do using standard CSS:

:root {// hsl()color:hsl(15deg,100%,50%);// separator: coma (`,`)--flashy-pink:hsl(15deg,100%,50%);// separator: space$flashy-pink:hsl(15deg100%50%);// hsl() accepts opacity as fourth parameter          👇--hue:15deg;--transparent-flashy-pink:hsl(var(--hue),100%,50%,.7);// hsla()$transparent-flashy-pink:hsla(15deg,100%,50%,.7);// hsla(): opacity after a slash (`/`) when separator is a space$transparent-flashy-pink:hsla(15deg100%50%/.7);}

Before / afterhsl.scss when usingnode-sass

Before: lot of issues. Now: no issues anymore.

Before: boring interpolation. Now: standard CSS.

About

Let HSL stay HSL in SCSS.

Topics

Resources

License

Stars

Watchers

Forks

Languages


[8]ページ先頭

©2009-2025 Movatter.jp