Compare commits

...

18 commits

Author SHA1 Message Date
marleyrae
2e24250818 Update README to point to correct package 2023-06-19 18:17:54 -07:00
marleyrae
920f16d159 Add .idea directory to gitignore 2023-06-19 18:11:54 -07:00
marleyrae
1dc35b2247 Update package.json 2023-06-19 18:03:55 -07:00
marleyrae
1e1c0a579b Build package 2023-06-19 18:03:35 -07:00
marleyrae
b4a0c5831d Update reset.css to my version 2023-06-19 18:03:01 -07:00
Andy Bell
e7500a6c7f
Merge pull request #36 from daviddarnes/patch-1
Only allow smooth scrolling when focused in the page
2021-01-18 10:52:37 +00:00
Andy Bell
3d88ede3e1 Buildy McBuildFace 2021-01-18 10:46:25 +00:00
Andy Bell
d60c41c896 Version bump 2021-01-18 10:45:18 +00:00
David Darnes
24f527e414
Prevent smooth scrolling for people who prefer reduced motion 2021-01-14 11:00:33 +00:00
David Darnes
6aed477cc9
Only allow smooth scrolling when focused in the page 2021-01-14 10:52:24 +00:00
Andy Bell
2b129490ed Build and bump 2020-11-06 19:36:02 +00:00
Andy Bell
41fe399128
Merge pull request #33 from hankchizljaw/feature/over-reaching-elements
Remove over-reaching elements
2020-11-06 19:35:28 +00:00
Andy Bell
4dff0e42dd
Merge pull request #29 from venikx/patch-1
Reduce motion of ::before and ::after pseudo-elements
2020-11-06 19:33:39 +00:00
Andy Bell
ba75f6d3ed Remove over-reaching elements 2020-11-06 19:33:20 +00:00
Andy Bell
372c2cb6a0 Build 2020-11-06 19:11:50 +00:00
Andy Bell
e3975a92b6 Hot Fix: fix whoopsie on list rules 2020-11-06 19:11:32 +00:00
Andy Bell
c0245f5a79
Merge pull request #32 from hankchizljaw/feature/update-lists
Feature/update lists
2020-11-06 17:10:09 +00:00
Kevin
f1ab7b6974
Reduce motion of ::before and ::after pseudo-elements
The change adds the `*::before` and *::after` in the reduce motion media query. Effectively these additions should prevent any animations which were happening in these pseudo-elements when the user has opted to reduce the motion. 

Why?
I've come across an edge case where I'm animating an `::after` (not sure if that's the ideal way to do it), but animations should be disabled for these pseudo-elements as well.
2020-10-22 02:30:38 +03:00
7 changed files with 130 additions and 169 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,32 +5,38 @@
![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 modern-css-reset
npm install --save-dev @punkfairie/modern-css-reset
```
Yarn:
```console
yarn add modern-css-reset
yarn add @punkfairie/modern-css-reset
```
Unpkg CDN:
```html
<link rel="stylesheet" href="https://unpkg.com/modern-css-reset/dist/reset.min.css" />
<link rel="stylesheet"
href="https://unpkg.com/@punkfairie/modern-css-reset/dist/reset.min.css"/>
```
jsDelivr CDN:
```html
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/modern-css-reset/dist/reset.min.css" />
<link rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/@punkfairie/modern-css-reset/dist/reset.min.css"/>
```
### Manual installation
@ -38,7 +44,7 @@ jsDelivr CDN:
First, let's clone this repository:
```console
git clone https://github.com/hankchizljaw/modern-css-reset.git
git clone https://github.com/punkfairie/modern-css-reset.git
```
Then, go to `modern-css-reset` directory:

128
dist/reset.css vendored
View file

@ -1,84 +1,60 @@
/* Box sizing rules */
*,
*::before,
*::after {
box-sizing: border-box;
}
@layer reset {
/* Box sizing rules */
*,
*::before,
*::after {
box-sizing: border-box;
}
/* Remove default margin */
body,
h1,
h2,
h3,
h4,
p,
figure,
blockquote,
dl,
dd {
margin: 0;
}
/* Remove default margin */
body,
h1,
h2,
h3,
h4,
p,
figure,
blockquote,
dl,
dd {
margin: 0;
}
/* Remove list styles on ul, ol elements with a list role, which suggests default styling will be removed */
ul[role="list"],
ol[role="list"] {
list-style: none;
}
/* Remove list styles on ul, ol elements with a list role, which suggests default styling will be removed */
ul[role="list"],
ol[role="list"] {
list-style: none;
}
/* Set core root defaults */
html {
scroll-behavior: smooth;
}
/* Set core root defaults */
html:focus-within {
scroll-behavior: smooth;
}
/* Set core body defaults */
body {
min-height: 100vh;
text-rendering: optimizeSpeed;
line-height: 1.5;
}
/* Set core body defaults */
body {
min-block-size: 100vb;
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;
}
/* A elements that don't have a class get default styles */
a:not([class]) {
text-decoration-skip-ink: auto;
}
/* Make images easier to work with */
img,
picture {
max-inline-size: 100%;
display: block;
}
/* Make images easier to work with */
img,
picture {
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,
textarea,
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;
}
/* Inherit fonts for inputs and buttons */
input,
button,
textarea,
select {
font: inherit;
}
}

2
dist/reset.min.css vendored
View file

@ -1 +1 @@
*,*::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}}
@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}}

2
package-lock.json generated
View file

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

View file

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

View file

@ -1,84 +1,60 @@
/* Box sizing rules */
*,
*::before,
*::after {
box-sizing: border-box;
}
@layer reset {
/* Box sizing rules */
*,
*::before,
*::after {
box-sizing: border-box;
}
/* Remove default margin */
body,
h1,
h2,
h3,
h4,
p,
figure,
blockquote,
dl,
dd {
margin: 0;
}
/* Remove default margin */
body,
h1,
h2,
h3,
h4,
p,
figure,
blockquote,
dl,
dd {
margin: 0;
}
/* Remove list styles on ul, ol elements with a list role, which suggests default styling will be removed */
ul[role="list"],
ol[role="list"] {
list-style: none;
}
/* Remove list styles on ul, ol elements with a list role, which suggests default styling will be removed */
ul[role="list"],
ol[role="list"] {
list-style: none;
}
/* Set core root defaults */
html {
scroll-behavior: smooth;
}
/* Set core root defaults */
html:focus-within {
scroll-behavior: smooth;
}
/* Set core body defaults */
body {
min-height: 100vh;
text-rendering: optimizeSpeed;
line-height: 1.5;
}
/* Set core body defaults */
body {
min-block-size: 100vb;
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;
}
/* A elements that don't have a class get default styles */
a:not([class]) {
text-decoration-skip-ink: auto;
}
/* Make images easier to work with */
img,
picture {
max-inline-size: 100%;
display: block;
}
/* Make images easier to work with */
img,
picture {
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,
textarea,
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;
}
/* Inherit fonts for inputs and buttons */
input,
button,
textarea,
select {
font: inherit;
}
}