Merge pull request #36 from daviddarnes/patch-1

Only allow smooth scrolling when focused in the page
This commit is contained in:
Andy Bell 2021-01-18 10:52:37 +00:00 committed by GitHub
commit e7500a6c7f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 11 additions and 5 deletions

5
dist/reset.css vendored
View file

@ -26,7 +26,7 @@ ol[role="list"] {
}
/* Set core root defaults */
html {
html:focus-within {
scroll-behavior: smooth;
}
@ -59,6 +59,9 @@ select {
/* Remove all animations and transitions for people that prefer not to see them */
@media (prefers-reduced-motion: reduce) {
html:focus-within {
scroll-behavior: auto;
}
*,
*::before,
*::after {

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}a:not([class]){text-decoration-skip-ink:auto}img,picture{max-width:100%;display:block}input,button,textarea,select{font:inherit}@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation-duration:.01ms !important;animation-iteration-count:1 !important;transition-duration:.01ms !important;scroll-behavior:auto !important}}
*,*::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-height:100vh;text-rendering:optimizeSpeed;line-height:1.5}a:not([class]){text-decoration-skip-ink:auto}img,picture{max-width:100%;display:block}input,button,textarea,select{font:inherit}@media(prefers-reduced-motion:reduce){html:focus-within{scroll-behavior:auto}*,*::before,*::after{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.0.4",
"version": "1.4.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View file

@ -1,6 +1,6 @@
{
"name": "modern-css-reset",
"version": "1.3.0",
"version": "1.4.0",
"description": "A bare-bones CSS reset for modern web development",
"main": "./dist/reset.min.css",
"scripts": {

View file

@ -26,7 +26,7 @@ ol[role="list"] {
}
/* Set core root defaults */
html {
html:focus-within {
scroll-behavior: smooth;
}
@ -59,6 +59,9 @@ select {
/* Remove all animations and transitions for people that prefer not to see them */
@media (prefers-reduced-motion: reduce) {
html:focus-within {
scroll-behavior: auto;
}
*,
*::before,
*::after {