Skip to content

postcss tools, To change the value of the sass or less variable

License

Notifications You must be signed in to change notification settings

mind029/cssAdapter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

postcss-easy-tools

  1. 合并 scss、less 主题到一个文件
  2. 传入对象,更改主题的变量 为传入的新值
  3. 转换成 scss、less 到 css

详细用法请查看 test里面的示例。

安装:

npm install postcss-easy-tools --save

用法

合并主题代码:

const StyleFile = require('../index')
const fs = require('fs')
const path = require('path')
const style = new StyleFile()


async function mergeStyle() {
  const paths = {
    styles: {
      from: 'test/scssTheme/index.scss',
      to: `test/scssTheme/dist/theme.scss`
    }
  }
  let scssSourceCode = fs.readFileSync(paths.styles.from)
  let mergeResult = await style.mergeStyle(scssSourceCode, {
    language: 'scss',
    from: paths.styles.from,
    to: paths.styles.to
  })
  return mergeResult
}

About

postcss tools, To change the value of the sass or less variable

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published