I'm Arvin Xu, a design engineer.
End | Stack |
---|---|
(⚠️WIP)a less plugin to enable dynamic variable by comile less variable to css variable, compatible with less function
简单来说,就是让 less 变量可以无痛迁移到 css variable 去。详见二楼 ⬇️
cosmiconfig
使用 cosmiconfig 式配置。
暂且将配置命名为
dynamic-theme
, 那么配置文件就是dynamic-theme.config.js
、.dynamic-themerc
等形式。
准备暂且只支持一个 variables
参数,其他需求后面再看
module.exports = {
variables: ["primary-color","green-4"]
}
如此一来,插件就会识别到 primary-color
和 green-4
变量是需要提升为 css variables 的。
lessc 直接执行的话
lessc file.less --css-variable-theme
引入到配置项中
const LessPluginCssVariablesTheme = require('less-plugin-css-variable-theme');
{
//...
lessLoaderOptions: {
plugins: [CssVariablesWithFunctions];
}
}
如下声明
@primary-color: #1890ff;
.use {
color: @primary-color;
}
会生成
:root {
--primary-color: #1890ff;
}
.use {
color: var(--primary-color);
}
社区插件仓库
开发笔记
资料库
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.