Compare commits

...

40 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
Andy Bell
86790da6f3 Bump 2020-11-06 17:08:48 +00:00
Andy Bell
6ac60ec6a0 Build 2020-11-06 17:08:31 +00:00
Andy Bell
d07d11fb2c Change list rules. Fixes #30 2020-11-06 17:08:15 +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
Andy Bell
f5531ac895 Bump 2020-07-21 15:55:10 +01:00
Andy Bell
af3e7ab84c
Merge pull request #27 from janKollars/image-consistency
set img styles also for picture tag
2020-07-21 15:53:37 +01:00
Jan Kollars
10444a8130 set img styles also for picture tag 2020-07-21 16:17:44 +02:00
Andy Bell
7be24c24e3
Merge pull request #24 from matpassmore/fix-scroll-behavior
Fix viewport smooth scroll-behavior
2020-04-02 19:23:24 +01:00
Matthew Passmore
52c4af07cd Fix viewport smooth scroll-behavior
The 'scroll-behavior' property of the HTML `body` element is not
propagated to the viewport. When applied to the root element, it applies
to the viewport.

@link https://drafts.csswg.org/cssom-view/#smooth-scrolling
2020-04-02 17:03:38 +01:00
Andy Bell
63eded4a15 Bump 2020-02-03 21:32:55 +00:00
Andy Bell
039ef70be8
Merge pull request #22 from hankchizljaw/feature/img-alt-detection
Feature/img alt detection
2020-02-03 21:31:59 +00:00
Andy Bell
f604adbb4d build 2020-02-03 21:30:44 +00:00
Andy Bell
d1f79f7477 Add blurred images with no alt attributes 2020-02-03 21:30:20 +00:00
Andy Bell
6741b54a00
Merge pull request #21 from koddr/master
Improve README, LICENSE and package.json
2020-01-23 22:21:05 +00:00
Vic Shóstak
f1c2ad174b
Update README.md 2020-01-24 01:09:15 +03:00
Vic Shóstak
2972283714
Update README.md 2020-01-24 01:07:21 +03:00
Andy Bell
6a0fee2fa5
Merge pull request #20 from jbcaprell/li-and-figcaption-margins
Remove `li` and `figcaption` from margin reset
2020-01-23 20:23:52 +00:00
Vic Shóstak
56a31c8375
Update package.json 2020-01-23 22:37:39 +03:00
Vic Shóstak
b90ddc861b
Rename LICENCE to LICENSE 2020-01-23 22:33:22 +03:00
Vic Shóstak
e084c1db08
Update README.md 2020-01-23 22:32:33 +03:00
Vic Shóstak
9f62f68e28
Update README.md 2020-01-23 22:31:48 +03:00
Vic Shóstak
2ae9afb06f
Rename LICENCE.txt to LICENCE 2020-01-23 22:17:56 +03:00
Jonathan Caprell
172a9dc0fd Remove li and figcaption from margin reset 2019-12-09 10:08:42 -05:00
8 changed files with 171 additions and 159 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,20 +5,62 @@
![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: `npm install modern-css-reset`
- Yarn: `yarn add modern-css-reset`
- CDN:
- Unpkg: `<link rel="stylesheet" href="https://unpkg.com/modern-css-reset/dist/reset.min.css" />`
- jsDelivr: `<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/modern-css-reset/dist/reset.min.css" />`
NPM:
## Commands
```console
npm install --save-dev @punkfairie/modern-css-reset
```
You can minify and move the main reset to the `dist` by running:
Yarn:
```bash
```console
yarn add @punkfairie/modern-css-reset
```
Unpkg CDN:
```html
<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/@punkfairie/modern-css-reset/dist/reset.min.css"/>
```
### Manual installation
First, let's clone this repository:
```console
git clone https://github.com/punkfairie/modern-css-reset.git
```
Then, go to `modern-css-reset` directory:
```console
cd modern-css-reset
```
And now, you can minify and move the main reset to the `dist` by running:
```console
npm run build
```
That's it! 🎉
## License
MIT

108
dist/reset.css vendored
View file

@ -1,78 +1,60 @@
/* Box sizing rules */
*,
*::before,
*::after {
@layer reset {
/* Box sizing rules */
*,
*::before,
*::after {
box-sizing: border-box;
}
}
/* Remove default padding */
ul[class],
ol[class] {
padding: 0;
}
/* Remove default margin */
body,
h1,
h2,
h3,
h4,
p,
ul[class],
ol[class],
li,
figure,
figcaption,
blockquote,
dl,
dd {
/* Remove default margin */
body,
h1,
h2,
h3,
h4,
p,
figure,
blockquote,
dl,
dd {
margin: 0;
}
}
/* Set core body defaults */
body {
min-height: 100vh;
/* 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:focus-within {
scroll-behavior: smooth;
}
/* 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]) {
/* 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 {
max-width: 100%;
/* Make images easier to work with */
img,
picture {
max-inline-size: 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 {
/* Inherit fonts for inputs and buttons */
input,
button,
textarea,
select {
font: inherit;
}
/* 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 @@
*,*::before,*::after{box-sizing:border-box}ul[class],ol[class]{padding:0}body,h1,h2,h3,h4,p,ul[class],ol[class],li,figure,figcaption,blockquote,dl,dd{margin:0}body{min-height:100vh;scroll-behavior:smooth;text-rendering:optimizeSpeed;line-height:1.5}ul[class],ol[class]{list-style:none}a:not([class]){text-decoration-skip-ink:auto}img{max-width:100%;display:block}article>*+*{margin-top:1em}input,button,textarea,select{font:inherit}@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.0.4",
"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,15 +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": [],
"author": "",
"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)"
],
"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,78 +1,60 @@
/* Box sizing rules */
*,
*::before,
*::after {
@layer reset {
/* Box sizing rules */
*,
*::before,
*::after {
box-sizing: border-box;
}
}
/* Remove default padding */
ul[class],
ol[class] {
padding: 0;
}
/* Remove default margin */
body,
h1,
h2,
h3,
h4,
p,
ul[class],
ol[class],
li,
figure,
figcaption,
blockquote,
dl,
dd {
/* Remove default margin */
body,
h1,
h2,
h3,
h4,
p,
figure,
blockquote,
dl,
dd {
margin: 0;
}
}
/* Set core body defaults */
body {
min-height: 100vh;
/* 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:focus-within {
scroll-behavior: smooth;
}
/* 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]) {
/* 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 {
max-width: 100%;
/* Make images easier to work with */
img,
picture {
max-inline-size: 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 {
/* Inherit fonts for inputs and buttons */
input,
button,
textarea,
select {
font: inherit;
}
/* 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;
}
}