All Projects → emeks-studio → antd-custom-theme-generator

emeks-studio / antd-custom-theme-generator

Licence: Apache-2.0 License
A simple way to create an antd theme css file with zero configuration.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to antd-custom-theme-generator

simpleCMS
simpleCMS是一款开源cms系统, 主要为个人/团队快速开发博客或者知识共享平台, 类似于hexo, worldpress, 但是他们往往需要复杂的搭建过程, 我们将复杂度降到最低, 并且有详细的部署教程, 你只需要有一台服务器, 就能轻松拥有一个属于你的博客平台.
Stars: ✭ 74 (+270%)
Mutual labels:  antd, antdesign
virtualized-table-for-antd
the virtualized table component for ant design
Stars: ✭ 193 (+865%)
Mutual labels:  antd, antdesign
umi-dva-typescript-mock
基于umi + dva + typescript + mock + antd的react框架,内置PWA
Stars: ✭ 17 (-15%)
Mutual labels:  antd, antdesign
react-vite-admin
This Starter utilizes React, Recoil, React Query, React Hooks, Typescript, Axios And Vite. 全新技术栈的后台管理系统
Stars: ✭ 90 (+350%)
Mutual labels:  antd
GOSH-FHIRworks2020-React-Dashboard
🩺 Fully Responsive FHIR Dashboard written using @reactjs for NHS and GOSH hackathon
Stars: ✭ 21 (+5%)
Mutual labels:  antd
cc-project-vue
一个基于vue3.0+antd+less+spring boot +mybatis+mysql+maven基础权限管理平台
Stars: ✭ 20 (+0%)
Mutual labels:  antd
lineageos-devices
LineageOS Devices
Stars: ✭ 31 (+55%)
Mutual labels:  antdesign
react-typescript
A Front-End Project with Typescript/Antd. webpack5+react-router4+antd+typescript4+grahql
Stars: ✭ 63 (+215%)
Mutual labels:  antd
react-antd-low-code
简易版 react 低代码平台
Stars: ✭ 45 (+125%)
Mutual labels:  antd
react-weather-app
☀️🌤⛈❄️A weather web application using React, Redux, Typescript, Webpack, Ant Design, ECharts and firebase.
Stars: ✭ 117 (+485%)
Mutual labels:  antd
pityWeb
🎉一个持续迭代的开源接口测试平台(前端),欢迎大家多提issue多给反馈。 求star⭐,我会努力更新下去的!
Stars: ✭ 25 (+25%)
Mutual labels:  antd
antd-curd
📦 基于 ant design 、 dva 、 antd-form-mate 的增删改查页面组件。
Stars: ✭ 26 (+30%)
Mutual labels:  antd
react-admin-nest
React和Ant Design和 Nest.js 和 Mysql 构建的后台通用管理系统。持续更新。
Stars: ✭ 123 (+515%)
Mutual labels:  antd
gatsby-wordpress-typescript-scss-blog
Gatsby Wordpress Typescript Blog Boilerplate
Stars: ✭ 50 (+150%)
Mutual labels:  antd
antd-color-replacer
适用于 webpack 环境下 的 主题切换插件
Stars: ✭ 22 (+10%)
Mutual labels:  antd
react-admin-template
react + antd + vite/webpack5 后台管理系统模板
Stars: ✭ 73 (+265%)
Mutual labels:  antd
nodejs-spider
No description or website provided.
Stars: ✭ 18 (-10%)
Mutual labels:  antd
trackupdates
A simple yaml-based xpath crawler framework for easy tracking site updates. https://zhupeng.github.io/
Stars: ✭ 20 (+0%)
Mutual labels:  antd
react-sendbird-messenger
ReactJS (React-router-dom v6 + Antdesign + Firebase + Sendbird + Sentry) codebase containing real world examples (CRUD, auth, advanced patterns, etc).
Stars: ✭ 39 (+95%)
Mutual labels:  antdesign
tinylog-ui
实时日志分析系统后台数据管理系统
Stars: ✭ 45 (+125%)
Mutual labels:  antdesign

Antd custom theme generator

A simple way to create an antd theme css file with zero configuration.

Ant Design provides plenty of UI components, styled with less. You can customize the default theme modifying less variables (check their doc for multiple ways to achieve this), but the main issue being that you don't have a simple way to create a static .css file with zero configuration.

This package was created with Antd Design v4.6.6 and aims to ease the theme's customization process without having to install more dependencies yourself, set up less or eject your React project.

Usage

Generate custom theme styles

  1. Define your custom theme creating a .less file overriding Antd's variables (by default: ./custom-theme.less).

    • Example:
      @primary-color: #9063cd;
      @success-color: #a8d3c4;
  2. Generate custom theme's .css file.

    • Option A:
      Without installing this package:
      $ npx @emeks/antd-custom-theme-generator
      
      output > ./custom-theme.css
    • Option B:
      Installing this package as a dev dependency:
      $ npm i -E --save-dev @emeks/antd-custom-theme-generator
      Then generating your theme:
      $ generate-theme
      
      default output > ./custom-theme.css
  3. Replace "antd/dist/antd.css" import in your project, with the output file of your custom theme generated by this script (by default: ./custom-theme.css).

Options

Name Default Description
--verbose or -v Prints a little bit more info for debugging purposes
--watch or -w Keeps script running, recompile on <customThemeFilePath> change
--antd ./node_modules/antd Path to the antd library directory
--theme default Antd theme you want to use as base (e.g. dark or compact) - Check available options
<customThemeFilePath> ./custom-theme.less Path to the custom .less file with Antd variables overriden
<generatedThemeFilePath> ./custom-theme.css Output Path to the compiled .css file containing your new theme

Notes:
The order of paths is important.

  $ generate-theme [--verbose] [--watch] [--antd <dir>] [--theme <theme>] [<customThemeFilePath>] [<generatedThemeFilePath>]

Examples

  • Generate a custom theme using dark theme as base:
    $ npx @emeks/antd-custom-theme-generator --theme dark
  • Generate a custom theme using default theme as base specifying non default paths:
    $ npx @emeks/antd-custom-theme-generator ./styles/custom-theme.less ./styles/custom-theme.css

FAQ

Q1: Which variables can I override?

You may override any variable exposed by Antd in this file.

Q2: Should I run this command every time I change my custom-theme.less file?

No, you could pass the -w argument to let the script observe <customThemeFilePath> file and recompile it if it changes.

Development

  • Inside package folder, link it globally:
    $ npm link
  • Use the package in your project (with antd already installed and a <customThemeFilePath> file created as well):
    $ generate-theme
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].