Skip to content

Library to pass Sass variables via CSS to JavaScript

Notifications You must be signed in to change notification settings

nsorog/sass-to-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sass-to-js

sass-to-js is API to read Sass variables from JavaScript.

It provides Sass methods to save Sass maps and list as JSON to CSS and

JavaScript helpers to read those strings from CSS to JavaScript objects.

It requires no dependencies!

Usage examples

You can use it e.g. for passing data from Sass to JS like:

  • media breakpoints list to reuse in JavaScript/HTML (e.g. in responsive image solutions)
  • some variables values (e.g. theme colors, dimensions etc.)
  • list of variable values which might be applied in some circumstances (columns count for different types of devices etc.)
  • to test your Sass code/framework with JavaScript

Install

via bower + ToDo publish via npm + ToDo publish

Usage

How to use in scss in js in jquery in AngularJS Describe params and debug Can be use as CommonJS/RequireJS modules

Links, demos

link to article demo + codepen

License

MIT

ToDo: Travis test

About

Library to pass Sass variables via CSS to JavaScript

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 68.7%
  • CSS 25.6%
  • HTML 5.7%