Collection of reset CSS stylesheets.
npm i @unocss-applet/reset --save-dev # with npm
yarn add @unocss-applet/reset -D # with yarn
pnpm add @unocss-applet/reset -D # with pnpm
You can add one of the following reset stylesheets to your entry file.
For uni-app, it should be src/main.[j|t]s
.
For taro, it should be src/app.[j|t]sx?
.
Preflight for button::after
. Will remove all button::after
styles.
// uni-app
import '@unocss-applet/reset/uni-app/button-after.css'
// taro
import '@unocss-applet/reset/taro/button-after.css'
Import this file before other reset files if you want to customize button border more flexibly.
It may bring conflicts with UI frameworks. Remove the import if you find button styles wrong.
NOT RECOMMEND since :where
is used which is not likely supported in many platforms.
Source: https://github.com/csstools/normalize.css
// uni-app
import '@unocss-applet/reset/uni-app/normalize.css'
// taro
import '@unocss-applet/reset/taro/normalize.css'
Source: https://github.com/sindresorhus/modern-normalize
// uni-app
import '@unocss-applet/reset/uni-app/modern-normalize.css'
// taro
import '@unocss-applet/reset/taro/modern-normalize.css'
NOT RECOMMEND since :where
is used which is not likely supported in many platforms.
Source: https://github.com/csstools/sanitize.css
// uni-app
import '@unocss-applet/reset/uni-app/sanitize/sanitize.css'
import '@unocss-applet/reset/uni-app/sanitize/assets.css'
// taro
import '@unocss-applet/reset/taro/sanitize/sanitize.css'
import '@unocss-applet/reset/taro/sanitize/assets.css'
Source: https://meyerweb.com/eric/tools/css/reset/index.html
// uni-app
import '@unocss-applet/reset/uni-app/eric-meyer.css'
// taro
import '@unocss-applet/reset/taro/eric-meyer.css'
Based on Tailwind's preflight, in static forms.
// uni-app
import '@unocss-applet/reset/uni-app/tailwind.css'
// taro
import '@unocss-applet/reset/taro/tailwind.css'
This is provided as a static version of Tailwind's preflight, so it doesn't inherit any styles from the theme.
In Tailwind's preflight, the border color default border color is read from the theme borderColor.DEFAULT. To customize it in Uno's reset, we use CSS variable instead:
/* uni-app */
@import '@unocss-applet/reset/uni-app/tailwind.css'
/* taro */
@import '@unocss-applet/reset/taro/tailwind.css'
:root {
--un-default-border-color: #e5e7eb;
}
We add conditional compilation in style files to bring cross-platform compatibility.
Based on tailwind.css, with some styles clean up to avoid conflicts with UI frameworks.
// uni-app
import '@unocss-applet/reset/uni-app/tailwind-compat.css'
// taro
import '@unocss-applet/reset/taro/tailwind-compat.css'
Linked issue: #2127
Before | After |
---|---|
button,
[type='button'],
[type='reset'],
[type='submit'] {
-webkit-appearance: button; /* 1 */
background-color: transparent; /* 2 */
background-image: none; /* 2 */
} |
button,
[type='button'],
[type='reset'],
[type='submit'] {
-webkit-appearance: button; /* 1 */
/*background-color: transparent; !* 2 *!*/
background-image: none; /* 2 */
} |
MIT License © 2022-PRESENT ModyQyW