Compare commits

..

No commits in common. "main" and "feature/update-lists" have entirely different histories.

7 changed files with 183 additions and 144 deletions

2
.gitignore vendored
View file

@ -1,9 +1,9 @@
*.log
npm-debug.*
*.scssc
*.log
*.swp
.DS_Store
.sass-cache
node_modules
test.html
.idea

View file

@ -5,38 +5,32 @@
![The Brotli size of this reset](https://img.badgesize.io/https://unpkg.com/modern-css-reset?compression=brotli&label=Brotli%20Size)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
A tiny little reset that you can use as the basis of your CSS projects. You can
read
a [breakdown of it here](https://hankchizljaw.com/wrote/a-modern-css-reset/).
A tiny little reset that you can use as the basis of your CSS projects. You can read a [breakdown of it here](https://hankchizljaw.com/wrote/a-modern-css-reset/).
## Installation
NPM:
```console
npm install --save-dev @punkfairie/modern-css-reset
npm install --save-dev modern-css-reset
```
Yarn:
```console
yarn add @punkfairie/modern-css-reset
yarn add modern-css-reset
```
Unpkg CDN:
```html
<link rel="stylesheet"
href="https://unpkg.com/@punkfairie/modern-css-reset/dist/reset.min.css"/>
<link rel="stylesheet" href="https://unpkg.com/modern-css-reset/dist/reset.min.css" />
```
jsDelivr CDN:
```html
<link rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/@punkfairie/modern-css-reset/dist/reset.min.css"/>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/modern-css-reset/dist/reset.min.css" />
```
### Manual installation
@ -44,7 +38,7 @@ jsDelivr CDN:
First, let's clone this repository:
```console
git clone https://github.com/punkfairie/modern-css-reset.git
git clone https://github.com/hankchizljaw/modern-css-reset.git
```
Then, go to `modern-css-reset` directory:

32
dist/reset.css vendored
View file

@ -1,4 +1,3 @@
@layer reset {
/* Box sizing rules */
*,
*::before,
@ -27,17 +26,23 @@
}
/* Set core root defaults */
html:focus-within {
html {
scroll-behavior: smooth;
}
/* Set core body defaults */
body {
min-block-size: 100vb;
min-height: 100vh;
text-rendering: optimizeSpeed;
line-height: 1.5;
}
/* Remove list styles on ul, ol elements with a class attribute */
ul[class],
ol[class] {
list-style: none;
}
/* A elements that don't have a class get default styles */
a:not([class]) {
text-decoration-skip-ink: auto;
@ -46,10 +51,15 @@
/* Make images easier to work with */
img,
picture {
max-inline-size: 100%;
max-width: 100%;
display: block;
}
/* Natural flow and rhythm in articles by default */
article > * + * {
margin-top: 1em;
}
/* Inherit fonts for inputs and buttons */
input,
button,
@ -57,4 +67,18 @@
select {
font: inherit;
}
/* Blur images when they have no alt attribute */
img:not([alt]) {
filter: blur(10px);
}
/* Remove all animations and transitions for people that prefer not to see them */
@media (prefers-reduced-motion: reduce) {
* {
animation-duration: 0.01ms !important;
animation-iteration-count: 1 !important;
transition-duration: 0.01ms !important;
scroll-behavior: auto !important;
}
}

2
dist/reset.min.css vendored
View file

@ -1 +1 @@
@layer reset{*,*::before,*::after{box-sizing:border-box}body,h1,h2,h3,h4,p,figure,blockquote,dl,dd{margin:0}ul[role="list"],ol[role="list"]{list-style:none}html:focus-within{scroll-behavior:smooth}body{min-block-size:100vb;text-rendering:optimizeSpeed;line-height:1.5}a:not([class]){text-decoration-skip-ink:auto}img,picture{max-inline-size:100%;display:block}input,button,textarea,select{font:inherit}}
*,*::before,*::after{box-sizing:border-box}body,h1,h2,h3,h4,p,figure,blockquote,dl,dd{margin:0}ul[role="list"],ol[role="list"]{list-style:none}html{scroll-behavior:smooth}body{min-height:100vh;text-rendering:optimizeSpeed;line-height:1.5}ul[class],ol[class]{list-style:none}a:not([class]){text-decoration-skip-ink:auto}img,picture{max-width:100%;display:block}article>*+*{margin-top:1em}input,button,textarea,select{font:inherit}img:not([alt]){filter:blur(10px)}@media(prefers-reduced-motion:reduce){*{animation-duration:.01ms !important;animation-iteration-count:1 !important;transition-duration:.01ms !important;scroll-behavior:auto !important}}

2
package-lock.json generated
View file

@ -1,6 +1,6 @@
{
"name": "modern-css-reset",
"version": "1.4.0",
"version": "1.0.4",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View file

@ -1,6 +1,6 @@
{
"name": "@punkfairie/modern-css-reset",
"version": "1.0.0",
"name": "modern-css-reset",
"version": "1.2.0",
"description": "A bare-bones CSS reset for modern web development",
"main": "./dist/reset.min.css",
"scripts": {
@ -8,21 +8,18 @@
},
"repository": {
"type": "git",
"url": "git+https://github.com/punkfairie/modern-css-reset.git"
"url": "git+https://github.com/hankchizljaw/modern-css-reset.git"
},
"keywords": [
"css reset",
"modern css reset"
],
"author": "Marley Rae <marleyrae@protonmail.com> (https://punkfairie.net)",
"contributors": [
"Andy Bell <me@andy-bell.design> (https://hankchizljaw.com)"
],
"author": "Andy Bell <me@andy-bell.design> (https://hankchizljaw.com)",
"license": "MIT",
"bugs": {
"url": "https://github.com/punkfairie/modern-css-reset/issues"
"url": "https://github.com/hankchizljaw/modern-css-reset/issues"
},
"homepage": "https://github.com/punkfairie/modern-css-reset#readme",
"homepage": "https://github.com/hankchizljaw/modern-css-reset#readme",
"devDependencies": {
"uglifycss": "0.0.29"
}

View file

@ -1,4 +1,3 @@
@layer reset {
/* Box sizing rules */
*,
*::before,
@ -27,17 +26,23 @@
}
/* Set core root defaults */
html:focus-within {
html {
scroll-behavior: smooth;
}
/* Set core body defaults */
body {
min-block-size: 100vb;
min-height: 100vh;
text-rendering: optimizeSpeed;
line-height: 1.5;
}
/* Remove list styles on ul, ol elements with a class attribute */
ul[class],
ol[class] {
list-style: none;
}
/* A elements that don't have a class get default styles */
a:not([class]) {
text-decoration-skip-ink: auto;
@ -46,10 +51,15 @@
/* Make images easier to work with */
img,
picture {
max-inline-size: 100%;
max-width: 100%;
display: block;
}
/* Natural flow and rhythm in articles by default */
article > * + * {
margin-top: 1em;
}
/* Inherit fonts for inputs and buttons */
input,
button,
@ -57,4 +67,18 @@
select {
font: inherit;
}
/* Blur images when they have no alt attribute */
img:not([alt]) {
filter: blur(10px);
}
/* Remove all animations and transitions for people that prefer not to see them */
@media (prefers-reduced-motion: reduce) {
* {
animation-duration: 0.01ms !important;
animation-iteration-count: 1 !important;
transition-duration: 0.01ms !important;
scroll-behavior: auto !important;
}
}