1
0
mirror of https://github.com/jdan/98.css.git synced 2025-01-17 20:58:32 +01:00
98.css/style.css

485 lines
10 KiB
CSS
Raw Normal View History

2020-04-21 19:18:56 -04:00
/**
* 98.css
* Copyright (c) 2020 Jordan Scales <thatjdanisso.cool>
* https://github.com/jdan/98.css/blob/master/LICENSE
*/
2020-04-17 13:13:16 -04:00
:root {
/* Color */
--surface: #c0c0c0;
--button-highlight: #ffffff;
--button-face: #dfdfdf;
--button-shadow: #808080;
--window-frame: #0a0a0a;
--dialog-blue: #000080;
--dialog-blue-light: #1084d0;
2020-04-18 08:56:01 -04:00
--link-blue: #0000ff;
2020-04-17 13:13:16 -04:00
2020-04-17 13:42:17 -04:00
/* Spacing */
--element-spacing: 8px;
2020-04-17 15:16:51 -04:00
--grouped-button-spacing: 4px;
--grouped-element-spacing: 6px;
--radio-width: 12px;
2020-04-17 15:40:54 -04:00
--checkbox-width: 13px;
2020-04-17 14:36:38 -04:00
--radio-label-spacing: 6px;
2020-04-17 13:42:17 -04:00
2020-04-17 15:40:54 -04:00
/* Some detailed computations for radio buttons and checkboxes */
2020-04-17 15:16:51 -04:00
--radio-total-width-precalc: var(--radio-width) + var(--radio-label-spacing);
--radio-total-width: calc(var(--radio-total-width-precalc));
--radio-left: calc(-1 * var(--radio-total-width-precalc));
--radio-dot-width: 4px;
--radio-dot-top: calc(var(--radio-width) / 2 - var(--radio-dot-width) / 2);
--radio-dot-left: calc(
-1 * (var(--radio-total-width-precalc)) + var(--radio-width) / 2 - var(
--radio-dot-width
) / 2
);
2020-04-17 15:16:51 -04:00
2020-04-17 15:40:54 -04:00
--checkbox-total-width-precalc: var(--checkbox-width) +
var(--radio-label-spacing);
--checkbox-total-width: calc(var(--checkbox-total-width-precalc));
--checkbox-left: calc(-1 * var(--checkbox-total-width-precalc));
--checkmark-width: 7px;
--checkmark-top: 3px;
--checkmark-left: 3px;
2020-04-17 15:40:54 -04:00
2020-04-17 13:13:16 -04:00
/* Borders */
2020-04-17 13:42:17 -04:00
--border-width: 1px;
2020-04-17 13:13:16 -04:00
--border-raised-outer: inset -1px -1px var(--window-frame),
inset 1px 1px var(--button-highlight);
--border-raised-inner: inset -2px -2px var(--button-shadow),
inset 2px 2px var(--button-face);
--border-sunken-outer: inset -1px -1px var(--button-highlight),
inset 1px 1px var(--window-frame);
--border-sunken-inner: inset -2px -2px var(--button-face),
inset 2px 2px var(--button-shadow);
2020-04-17 15:40:54 -04:00
2020-04-18 07:59:49 -04:00
/* Field borders (checkbox, input, etc) flip window-frame and button-shadow */
--border-field: inset -1px -1px var(--button-highlight),
2020-04-17 15:40:54 -04:00
inset 1px 1px var(--button-shadow), inset -2px -2px var(--button-face),
inset 2px 2px var(--window-frame);
2020-04-17 13:13:16 -04:00
}
* {
2020-04-21 08:37:44 -04:00
font-family: Arial;
font-size: 12px;
2020-04-17 13:13:16 -04:00
-webkit-font-smoothing: none;
color: #222222;
}
2020-04-21 10:09:54 -04:00
h1 {
font-size: 5rem;
}
h2 {
font-size: 2.5rem;
}
h3 {
font-size: 2rem;
}
2020-04-21 18:34:21 -04:00
h4 {
font-size: 1.5rem;
}
2020-04-17 13:13:16 -04:00
u {
text-decoration: none;
border-bottom: 0.5px solid #222222;
}
button {
box-sizing: border-box;
border: none;
background: var(--surface);
box-shadow: var(--border-raised-outer), var(--border-raised-inner);
2020-04-22 16:41:27 +01:00
border-radius: 0;
2020-04-17 13:13:16 -04:00
min-width: 75px;
min-height: 23px;
2020-04-20 14:23:06 -04:00
padding: 0 12px;
2020-04-17 13:13:16 -04:00
}
2020-04-22 07:36:54 +00:00
button:not(:disabled):active {
2020-04-17 13:13:16 -04:00
box-shadow: var(--border-sunken-outer), var(--border-sunken-inner);
}
button:focus {
outline: 1px dotted #000000;
outline-offset: -4px;
}
:disabled,
:disabled + label {
2020-04-17 13:42:17 -04:00
color: var(--button-shadow);
text-shadow: 1px 1px 0 var(--button-highlight);
}
2020-04-21 18:16:21 -04:00
.window {
2020-04-17 13:13:16 -04:00
box-shadow: var(--border-raised-outer), var(--border-raised-inner);
background: var(--surface);
2020-04-20 14:23:06 -04:00
padding: 3px;
2020-04-17 13:13:16 -04:00
}
2020-04-21 18:16:21 -04:00
.title-bar {
2020-04-17 13:13:16 -04:00
background: linear-gradient(
90deg,
var(--dialog-blue),
var(--dialog-blue-light)
);
padding: 2px;
display: flex;
justify-content: space-between;
align-items: center;
}
2020-04-21 18:51:34 -04:00
.title-bar-text {
2020-04-17 13:13:16 -04:00
font-weight: bold;
color: white;
2020-04-21 10:09:54 -04:00
letter-spacing: 0;
2020-04-17 13:13:16 -04:00
margin-right: 24px;
}
2020-04-21 18:16:21 -04:00
.title-bar-controls {
2020-04-17 13:13:16 -04:00
display: flex;
}
2020-04-21 18:16:21 -04:00
.title-bar-controls button {
2020-04-20 14:23:06 -04:00
padding: 0;
2020-04-17 13:13:16 -04:00
display: block;
min-width: 14px;
min-height: 12px;
}
2020-04-21 18:16:21 -04:00
.title-bar-controls button:focus {
2020-04-17 13:13:16 -04:00
outline: none;
}
2020-04-21 18:16:21 -04:00
.title-bar-controls button[aria-label="Minimize"] {
background-image: svg-load("./icon/minimize.svg");
2020-04-17 13:13:16 -04:00
background-repeat: no-repeat;
background-position: bottom 2px left 3px;
}
2020-04-21 18:16:21 -04:00
.title-bar-controls button[aria-label="Maximize"] {
background-image: svg-load("./icon/maximize.svg");
2020-04-17 13:13:16 -04:00
background-repeat: no-repeat;
/* Off by 1px because contents can't go above the inner shadow */
/* Should be 9px by 9px, with top 1px */
background-position: top 2px left 2px;
}
2020-04-21 18:16:21 -04:00
.title-bar-controls button[aria-label="Close"] {
2020-04-17 13:13:16 -04:00
margin-left: 2px;
background-image: svg-load("./icon/close.svg");
2020-04-17 13:13:16 -04:00
background-repeat: no-repeat;
background-position: top 2px center;
}
2020-04-21 18:16:21 -04:00
.window-body {
2020-04-17 13:42:17 -04:00
margin: var(--element-spacing);
2020-04-17 13:13:16 -04:00
}
2020-04-17 13:42:17 -04:00
fieldset {
border: none;
box-shadow: var(--border-sunken-outer), var(--border-raised-inner);
padding: calc(2 * var(--border-width) + var(--element-spacing));
2020-04-17 15:16:51 -04:00
padding-block-start: var(--element-spacing);
2020-04-17 15:49:53 -04:00
margin: 0;
2020-04-17 13:42:17 -04:00
}
legend {
background: var(--surface);
}
.field-row {
display: flex;
align-items: center;
}
[class^="field-row"] + [class^="field-row"] {
margin-top: var(--grouped-element-spacing);
}
.field-row * + * {
margin-left: var(--grouped-element-spacing);
}
.field-row-stacked {
display: flex;
flex-direction: column;
}
.field-row-stacked * + * {
margin-top: var(--grouped-element-spacing);
2020-04-17 13:13:16 -04:00
}
2020-04-17 14:36:38 -04:00
label {
2020-04-20 14:52:33 -04:00
display: inline-flex;
2020-04-21 10:09:54 -04:00
line-height: 1;
2020-04-17 14:36:38 -04:00
align-items: center;
}
2020-04-17 15:16:51 -04:00
2020-04-17 15:40:54 -04:00
input[type="radio"],
input[type="checkbox"] {
2020-04-17 15:16:51 -04:00
appearance: none;
-webkit-appearance: none;
-moz-appearance: none;
margin: 0;
2020-04-17 15:40:54 -04:00
border: none;
2020-04-17 14:36:38 -04:00
}
2020-04-17 15:16:51 -04:00
2020-04-17 14:36:38 -04:00
input[type="radio"] + label {
position: relative;
2020-04-17 15:16:51 -04:00
margin-left: var(--radio-total-width);
2020-04-17 14:36:38 -04:00
}
2020-04-17 15:16:51 -04:00
2020-04-17 14:36:38 -04:00
input[type="radio"] + label::before {
content: "";
2020-04-17 15:16:51 -04:00
position: absolute;
left: calc(-1 * (var(--radio-total-width-precalc)));
2020-04-17 14:36:38 -04:00
display: inline-block;
2020-04-17 15:16:51 -04:00
width: var(--radio-width);
height: var(--radio-width);
2020-04-17 14:36:38 -04:00
margin-right: var(--radio-label-spacing);
background: svg-load("./icon/radio-border.svg");
2020-04-17 14:36:38 -04:00
}
2020-04-17 15:16:51 -04:00
2020-04-17 14:36:38 -04:00
input[type="radio"]:checked + label::after {
content: "";
display: block;
2020-04-17 15:16:51 -04:00
width: var(--radio-dot-width);
height: var(--radio-dot-width);
top: var(--radio-dot-top);
left: var(--radio-dot-left);
2020-04-17 14:36:38 -04:00
position: absolute;
background: svg-load("./icon/radio-dot.svg");
2020-04-17 14:36:38 -04:00
}
2020-04-17 15:16:51 -04:00
2020-04-17 15:40:54 -04:00
input[type="radio"]:focus + label,
input[type="checkbox"]:focus + label {
2020-04-17 15:16:51 -04:00
outline: 1px dotted #000000;
}
2020-04-17 14:36:38 -04:00
input[type="radio"][disabled] + label::before {
background: svg-load("./icon/radio-border-disabled.svg");
2020-04-17 14:36:38 -04:00
}
2020-04-17 15:16:51 -04:00
2020-04-17 14:36:38 -04:00
input[type="radio"][disabled]:checked + label::after {
background: svg-load("./icon/radio-dot-disabled.svg");
2020-04-17 14:36:38 -04:00
}
2020-04-17 15:40:54 -04:00
input[type="checkbox"] + label {
position: relative;
margin-left: var(--checkbox-total-width);
}
input[type="checkbox"] + label::before {
content: "";
position: absolute;
left: calc(-1 * (var(--checkbox-total-width-precalc)));
2020-04-17 15:40:54 -04:00
display: inline-block;
width: var(--checkbox-width);
height: var(--checkbox-width);
background: var(--button-highlight);
2020-04-18 07:59:49 -04:00
box-shadow: var(--border-field);
2020-04-17 15:40:54 -04:00
margin-right: var(--radio-label-spacing);
}
input[type="checkbox"]:checked + label::after {
content: "";
display: block;
width: var(--checkmark-width);
height: var(--checkmark-width);
position: absolute;
top: var(--checkmark-top);
left: calc(
-1 * (var(--checkbox-total-width-precalc)) + var(--checkmark-left)
);
background: svg-load("./icon/checkmark.svg");
2020-04-17 15:40:54 -04:00
}
input[type="checkbox"][disabled] + label::before {
background: var(--surface);
}
input[type="checkbox"][disabled]:checked + label::after {
background: svg-load("./icon/checkmark-disabled.svg");
2020-04-17 15:40:54 -04:00
}
2020-04-18 07:59:49 -04:00
2020-04-18 08:45:16 -04:00
input[type="text"],
select,
textarea {
padding: 3px 4px;
border: none;
box-shadow: var(--border-field);
background-color: var(--button-highlight);
box-sizing: border-box;
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
border-radius: 0;
2020-04-18 08:45:16 -04:00
}
input[type="text"],
select {
height: 21px;
}
input[type="text"] {
/* For some reason descenders are getting cut off without this */
line-height: 2;
}
2020-04-18 07:59:49 -04:00
select {
appearance: none;
-webkit-appearance: none;
-moz-appearance: none;
position: relative;
2020-04-21 18:38:47 -04:00
padding-right: 32px;
background-image: svg-load("./icon/button-down.svg");
2020-04-18 07:59:49 -04:00
background-position: top 2px right 2px;
background-repeat: no-repeat;
2020-04-21 21:38:24 -04:00
border-radius: 0;
2020-04-18 07:59:49 -04:00
}
2020-04-18 08:45:16 -04:00
select:focus,
input[type="text"]:focus,
textarea:focus {
2020-04-18 07:59:49 -04:00
outline: none;
}
2020-04-18 11:10:45 -04:00
select:focus {
color: var(--button-highlight);
background-color: var(--dialog-blue);
}
select:focus option {
color: #000;
background-color: #fff;
}
2020-04-18 07:59:49 -04:00
select:active {
background-image: svg-load("./icon/button-down-active.svg");
2020-04-18 07:59:49 -04:00
}
2020-04-18 08:56:01 -04:00
a {
color: var(--link-blue);
}
a:focus {
outline: 1px dotted var(--link-blue);
}
2020-04-18 11:05:27 -04:00
2020-04-21 19:18:56 -04:00
ul.tree-view {
2020-04-20 14:23:06 -04:00
display: block;
2020-04-18 15:39:47 -04:00
background: var(--button-highlight);
box-shadow: var(--border-field);
2020-04-20 14:23:06 -04:00
padding: 6px;
margin: 0;
2020-04-18 15:39:47 -04:00
}
2020-04-21 19:18:56 -04:00
ul.tree-view li {
2020-04-18 15:39:47 -04:00
list-style-type: none;
}
2020-04-21 19:18:56 -04:00
ul.tree-view a {
2020-04-18 15:39:47 -04:00
text-decoration: none;
color: #000;
}
2020-04-21 19:18:56 -04:00
ul.tree-view a:focus {
2020-04-18 15:39:47 -04:00
background-color: var(--dialog-blue);
color: var(--button-highlight);
}
2020-04-21 19:18:56 -04:00
ul.tree-view ul,
ul.tree-view li {
2020-04-18 15:39:47 -04:00
margin-top: 3px;
}
2020-04-21 19:18:56 -04:00
ul.tree-view ul {
2020-04-18 15:39:47 -04:00
margin-left: 16px;
padding-left: 16px;
/* Goes down too far */
border-left: 1px dotted #808080;
}
2020-04-21 19:18:56 -04:00
ul.tree-view ul > li {
2020-04-18 15:39:47 -04:00
position: relative;
}
2020-04-21 19:18:56 -04:00
ul.tree-view ul > li::before {
2020-04-18 15:39:47 -04:00
content: "";
display: block;
position: absolute;
left: -16px;
top: 6px;
width: 12px;
border-bottom: 1px dotted #808080;
}
/* Cover the bottom of the left dotted border */
2020-04-21 19:18:56 -04:00
ul.tree-view ul > li:last-child::after {
2020-04-18 15:39:47 -04:00
content: "";
display: block;
position: absolute;
left: -20px;
top: 7px;
bottom: 0px;
width: 8px;
background: var(--button-highlight);
2020-04-18 11:05:27 -04:00
}
2020-04-20 14:52:33 -04:00
pre {
2020-04-20 14:23:06 -04:00
display: block;
background: var(--button-highlight);
box-shadow: var(--border-field);
padding: 12px 8px;
margin: 0;
}
2020-04-21 15:46:35 -04:00
code,
code * {
2020-04-20 14:52:33 -04:00
font-family: monospace;
}
summary:focus {
outline: 1px dotted #000000;
}
2020-04-18 11:05:27 -04:00
::-webkit-scrollbar {
width: 16px;
}
2020-04-18 11:19:13 -04:00
::-webkit-scrollbar:horizontal {
height: 17px;
}
::-webkit-scrollbar-corner {
background: var(--button-face);
}
2020-04-18 11:05:27 -04:00
::-webkit-scrollbar-track {
background-image: svg-load("./icon/scrollbar-background.svg");
2020-04-18 11:05:27 -04:00
}
::-webkit-scrollbar-thumb {
background-color: var(--button-face);
box-shadow: var(--border-raised-outer), var(--border-raised-inner);
}
::-webkit-scrollbar-button:vertical:start {
height: 17px;
background-image: svg-load("./icon/button-up.svg");
2020-04-18 11:05:27 -04:00
}
::-webkit-scrollbar-button:vertical:end {
height: 17px;
background-image: svg-load("./icon/button-down.svg");
2020-04-18 11:05:27 -04:00
}
::-webkit-scrollbar-button:horizontal:start {
2020-04-18 11:19:13 -04:00
width: 16px;
background-image: svg-load("./icon/button-left.svg");
2020-04-18 11:05:27 -04:00
}
::-webkit-scrollbar-button:horizontal:end {
2020-04-18 11:19:13 -04:00
width: 16px;
background-image: svg-load("./icon/button-right.svg");
2020-04-18 11:05:27 -04:00
}