noicss.reset
Version:
reset / normalize by noicss. In modern vanilla CSS.
278 lines (264 loc) • 5.11 kB
CSS
/* stylelint-disable color-named */
/* stylelint-disable property-no-vendor-prefix */
@property --accentColor {
syntax: "<color>";
inherits: true;
initial-value: magenta;
}
@property --outlineColor {
syntax: "<color>";
inherits: true;
initial-value: magenta;
}
@property --caretColor {
syntax: "<color>";
inherits: true;
initial-value: magenta;
}
@property --highlightedTextColor {
syntax: "<color>";
inherits: true;
initial-value: currentcolor;
}
@property --highlightedTextBgColor {
syntax: "<color>";
inherits: true;
initial-value: magenta;
}
:root {
--highlightedTextBgColor: var(--accentColor);
--highlightedTextColor: color-mix(in oklch, var(--highlightedTextBgColor) 25%, contrast-color(var(--highlightedTextBgColor)));
--outlineColor: var(--accentColor);
--caretColor: var(--accentColor);
}
@supports (view-transition-name: custom-ident) {
@view-transition {
navigation: auto;
}
}
*,
::after,
::before,
::details-content,
::file-selector-button,
::placeholder {
box-sizing: border-box;
margin: 0;
padding: 0;
overflow-wrap: break-word;
border: none;
@supports (transition-behavior: allow-discrete) {
/* used to transition from display: none; to display: block; */
transition-behavior: allow-discrete;
}
@supports (interpolate-size: allow-keywords) {
/* used to transition from height: 0; to height: auto; without using the calc-size() function */
interpolate-size: allow-keywords;
}
}
* {
scroll-margin: 1.5rlh;
&:focus-visible {
outline: 2px solid var(--outlineColor);
outline-offset: 2px;
}
}
::selection,
::target-text {
color: var(--highlightedTextColor);
background-color: var(--highlightedTextBgColor);
scroll-margin: 1.5rlh;
}
::search-text {
color: var(--highlightedTextBgColor);
text-decoration-color: var(--highlightedTextBgColor);
background-color: var(--highlightedTextColor);
}
::search-text:current {
color: var(--highlightedTextColor);
text-decoration-color: var(--highlightedTextColor);
background-color: var(--highlightedTextBgColor);
}
html {
color-scheme: light dark;
font-size: 100%;
line-height: 1.5;
-moz-tab-size: 2;
tab-size: 2;
accent-color: var(--accentColor);
-webkit-text-size-adjust: 100%;
-webkit-font-smoothing: antialiased;
@media (prefers-reduced-motion: no-preference) {
scroll-behavior: smooth;
}
&:has(dialog[open]:modal) {
overflow: hidden;
scrollbar-gutter: stable;
}
/* for google translate: */
&.translated-rtl {
direction: rtl;
}
}
hr {
height: 0;
color: inherit;
}
abbr[title] {
text-decoration: underline dotted;
}
b,
strong,
dt {
font-weight: bold;
}
ul,
ol,
dl {
list-style-position: inside;
ul,
ol,
dl {
padding-inline-start: 2ch;
}
}
code,
kbd,
pre,
samp {
font-family: Hack, ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
font-size: 1em;
}
small {
font-size: 80%;
}
sub,
sup {
vertical-align: baseline;
position: relative;
font-size: 75%;
line-height: 0;
}
sub {
bottom: -0.25em;
}
sup {
top: -0.5em;
}
table {
text-indent: 0;
border-color: inherit;
}
[type="button"],
[type="reset"],
[type="submit"],
[type="file"]::file-selector-button,
button,
input,
textarea,
select,
optgroup,
option {
margin: 0;
font: inherit;
letter-spacing: inherit;
word-spacing: inherit;
@supports (field-sizing: content) {
field-sizing: content;
}
}
input,
textarea,
[contenteditable] {
min-width: 0;
caret-color: var(--caretColor);
}
[type="text"],
[type="search"],
textarea,
[contenteditable] {
@supports selector(*::spelling-error) {
&::spelling-error {
text-decoration: from-font red wavy underline;
}
}
@supports selector(*::grammar-error) {
&::grammar-error {
text-decoration: from-font blue wavy underline;
}
}
}
button,
select {
text-transform: none;
}
[type="button"],
[type="reset"],
[type="submit"],
[type="file"]::-webkit-file-upload-button,
button {
-webkit-appearance: button;
color: Canvas;
border: 1px solid transparent; /* windows high contrast accessibility thing */
background: CanvasText;
@supports (text-box: trim-both cap alphabetic) {
text-box: trim-both cap alphabetic;
}
}
[aria-disabled="true" i],
[disabled] {
cursor: not-allowed;
}
::-moz-focus-inner {
padding: 0;
border-style: none;
}
:-moz-focusring {
outline: 1px dotted ButtonText;
}
:-moz-ui-invalid {
box-shadow: none;
}
legend {
padding: 0;
}
progress {
vertical-align: baseline;
}
::-webkit-inner-spin-button,
::-webkit-outer-spin-button {
height: auto;
}
[type="search"] {
-webkit-appearance: textfield;
outline-offset: -2px;
}
::-webkit-search-decoration {
-webkit-appearance: none;
}
summary {
display: list-item;
}
[popover] {
inset: auto;
@supports (position-area: top) {
position-area: top;
position-try-fallbacks:
flip-block,
flip-start,
flip-start flip-inline;
}
}
dialog {
max-width: 100%;
max-height: 100%;
}
img,
picture,
video,
canvas,
svg {
width: auto;
height: auto;
user-select: none;
}