Reset compilation = modern reset + meyer's reset + normalizer
Demo: https://frontend-layers.github.io/scss-reset/test/index.html
- Based on Meyer's CSS Reset
- Modernized modern-css-reset
- Useful parts from normalize.css
- Optional typography and mobile friendly definitions by SCSS variables (REM, BEM(int))
- Expandable by prebuilded mixins and ports (Accessability, HTML and Web compoents, etc.)
For instantly fix some persistent CSS issues and add missing parts for popular CSS resets. It is also compatible with other HTML/CSS frameworks like Twitter Bootstrap, Tailwind CSS, etc. You can extend styles reset by mixin collection and easily improve it.
npm i scss-reset --save-dev
yarn add scss-reset --dev
pnpm i scss-reset --dev
Please include into top of the main.scss:
@use 'scss-reset/reset';
or depends of your workspace configuration will works too:
@use '../node_modules/scss-reset/src/scss/_reset.scss';
or:
@use '../node_modules/scss-reset/_reset.scss';
or by (mostly) depricated way:
@import 'scss-reset/reset';
Optimized and compressed CSS version for _reset.scss
<link rel="stylesheet" href="https://unpkg.com/scss-reset/reset.css">
Transferred size: 3.62 kB
- _variables.scss
- _typography.scss
You can copy them from to development folder for additional custom modifications
'node_modules/scss-reset/src/scss/_variables.scss';
'node_modules/scss-reset/src/scss/_typography.scss';
- Please, copy reset-shopify-down.css from '/res' npm folder to '/assets' theme folder
- Please, include reset-shopify-down.css into 'layout/theme.liquid/' after base.css
{{ 'reset-shopify-down.css' | asset_url | stylesheet_tag }}
Please, use _total-reset.scss for Web Components or for modern JavaScript Apps where need to ❗deep reset all properties of the ❗Shadow DOM elements without reset Document styles.
@use 'scss-reset/total-reset';
Please include into necessary module:
@use 'scss-reset/reset-mixins' as *;
Mixins | Include | Description |
---|---|---|
disableAnimation | @include disableAnimation; | Disable CSS animation |
acDisableAnimation | @include acDisableAnimation; | Disable CSS animation depends of OS configuration |
acModeBW | @include acModeBW; | Grayscale Mode |
acModeContrast | @include acModeContrast; | Contrast Mode with Inverted colors |
meterReset | @include meterReset; | Styles reset for <meter> |
progressReset | @include progressReset; | Styles reset for <progress> |
inputColorReset | @include inputColorReset; | Rest for input type:color |
offx | @include offx; | Prevent horizontal overflow issues for elements |
offxAll | @include offxAll; | offx for whole document |
This mixin will add this snippet:
html, body {
overflow-x: hidden
}
Please be careful. You'll got scroll fix for whole page, but:
- It isn't good for accessibility because it hides overflowed content permanently
- CSS poperty
position: sticky;
doesn't work because an ancestor element (html, body
) has overflow property set.
Please use @include offx;
for selected block elements instead to avoid CSS 'sticky' and UX issues.
For example:
.page-content {
@include offx;
}
- Compressed CSS version: /build/reset.css
- Test Pages List: /test/index.html
For issues, bugs or improvements please open an issue