@alifd/sass-tracker
v0.1.2
Published
sass tracker
Downloads
152
Readme
sass-tracker
sass变量追踪器
Installation
$ npm install @no-repeat/sass-tracker --save
Getting Started
import SassTracker from '@no-repeat/sass-tracker';
/**
* @param {Object} window对象
* @param {String} 要追踪的class前缀
*/
const sassTracker = new SassTracker(window, '.button-')
// sass-mapper获得的映射表
const varsMap = {};
// 要追踪的元素
const elem = document.getElementById('demo-item');
const cssRules = sassTracker.findCssRules(elem, true);
const vars = sassTracker.findVars(cssRules, varsMap);