8000 GitHub - yunsii/postcss-antd-fixes: PostCSS plugin tries to fix all issues about antd with any others global CSS reset
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

yunsii/postcss-antd-fixes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

postcss-antd-fixes

NPM version Download monthly

PostCSS plugin tries to fix all issues about antd with any others global CSS reset

Features

Note

If your antd version >=5, you can use @layer to fix. Also you may have a quesion: Can I use @layer?

Usage

// postcss.config.js
module.exports = {
  plugins: {
    'tailwindcss': {},
    'autoprefixer': {},
    'postcss-antd-fixes': {
      // Support multiple prefixes, if you do not custom antd class name prefix, it's not necessary option.
      prefixes: ['vp-antd', 'ant'],
    },
  },
}

Transforms

Transform button styles

button,
[type='button'],
[type='reset'],
[type='submit'] {
  -webkit-appearance: button; /* 1 */
  background-color: transparent; /* 2 */
  background-image: none; /* 2 */
}

/* => */

button:where(:not([class^='ant'])),
[type='button']:where(:not([class^='ant'])),
[type='reset']:where(:not([class^='ant'])),
[type='submit']:where(:not([class^='ant'])) {
  -webkit-appearance: button; /* 1 */
  background-color: transparent; /* 2 */
  background-image: none; /* 2 */
}

Add anchor styles

:where([class^='ant']) a {
  /* colorPrimary */
  color: #1677ff;
  text-decoration: none;
}

Build & Publish

  • npm run build
  • npx changeset
  • npx changeset version
  • git commit
  • npx changeset publish
  • git push --follow-tags

changeset prerelease doc

License

MIT License © 2023 Yuns

About

PostCSS plugin tries to fix all issues about antd with any others global CSS reset

Topics

Resources

License

Stars

Watchers

Forks

0