botsym-css/scss/style.scss

446 lines
7.5 KiB
SCSS
Raw Normal View History

2017-10-01 21:55:29 +02:00
@charset "UTF-8";
$default-black: rgb(0, 0, 0);
$default-white: rgb(201, 201, 201);
$default-blue: rgb(23, 28, 148);
$em-height: 16px;
$line-overflow: 5px;
2020-09-30 15:24:49 +02:00
$line-height: $em-height+$line-overflow;
2017-10-01 21:55:29 +02:00
$box-border: 2px;
2017-10-01 22:26:57 +02:00
$box-double-border: 4px;
2017-10-01 22:51:43 +02:00
@mixin whiteOnBlue {
background-color: $default-blue;
color: $default-white;
border-color: $default-white;
}
2020-09-30 15:24:49 +02:00
2017-10-01 22:51:43 +02:00
@mixin blueOnWhite {
background-color: $default-white;
color: $default-blue;
border-color: $default-blue;
}
2020-09-30 15:24:49 +02:00
2017-10-01 22:51:43 +02:00
@mixin whiteOnBlack {
background-color: $default-black;
color: $default-white;
border-color: $default-white;
}
2020-09-30 15:24:49 +02:00
2017-10-01 22:51:43 +02:00
@mixin blackOnWhite {
background-color: $default-white;
color: $default-black;
border-color: $default-black;
}
@mixin hoverable($hoverFg, $hoverBg) {
&:hover {
cursor: pointer;
color: $hoverFg;
background-color: $hoverBg;
}
}
2020-09-29 19:23:00 +02:00
@font-face {
font-family: "Iosevka Slab Regular";
src: url("../fonts/iosevka-slab-regular.woff2") format("woff2");
}
2020-09-30 15:24:49 +02:00
:root {
// Styles applying to everyting
2020-09-29 19:23:00 +02:00
font-family: "Iosevka Slab Regular", "monospace";
2017-10-01 22:51:43 +02:00
@include whiteOnBlack;
2017-10-01 21:55:29 +02:00
font-weight: 400;
font-size: $em-height;
line-height: $line-height;
}
2020-09-30 15:24:49 +02:00
2017-10-01 22:51:43 +02:00
/* General styles for elements */
2017-10-01 21:55:29 +02:00
2020-09-30 15:24:49 +02:00
* {
// Remove margin and padding from everything by default
2017-10-01 21:55:29 +02:00
margin: 0;
padding: 0;
}
p {
width: auto;
}
2020-09-30 15:24:49 +02:00
b {
// Bolded text
2017-10-01 21:55:29 +02:00
font-weight: 1000;
}
li {
list-style: none;
}
ul {
padding-left: 1ch;
}
a {
color: $default-white;
2020-09-30 15:24:49 +02:00
@include hoverable($default-white,
$default-blue);
2017-10-01 21:55:29 +02:00
}
2020-09-30 15:24:49 +02:00
nav ul>li>ul:hover a {
2017-10-01 21:55:29 +02:00
color: $default-white;
}
hr {
height: $line-height / 2;
border: 0;
border-bottom: 1px solid $default-white;
2020-09-30 15:24:49 +02:00
margin-bottom: $line-height / 2 - 1px;
2017-10-01 21:55:29 +02:00
}
2020-09-30 15:24:49 +02:00
nav li hr,
li.button-list>ul a hr,
.white hr {
2017-10-01 21:55:29 +02:00
border-color: $default-black;
}
2020-09-30 15:24:49 +02:00
nav>li>ul li>ul:hover>hr,
li.button-list>ul:hover a hr {
2017-10-01 21:55:29 +02:00
border-color: $default-white;
}
2020-09-30 15:24:49 +02:00
2017-10-01 22:51:43 +02:00
/* Lists */
2017-10-01 21:55:29 +02:00
li {
2020-09-30 15:24:49 +02:00
&:not(.button-list)>ul::before {
2017-10-01 21:55:29 +02:00
content: "- ";
}
2020-09-30 15:24:49 +02:00
&.button-list>ul {
2017-10-01 21:55:29 +02:00
width: calc(100% - 1ch);
text-decoration: underline;
2020-09-30 15:24:49 +02:00
@include hoverable($default-white,
$default-blue);
&>li {
2017-10-01 21:55:29 +02:00
width: 100%;
}
a {
2020-09-30 15:24:49 +02:00
display: block;
width: 100%;
2017-10-01 21:55:29 +02:00
}
}
}
2020-09-30 15:24:49 +02:00
/* Navbars */
2017-10-01 21:55:29 +02:00
2020-09-30 15:24:49 +02:00
@keyframes hide {
0% {
opacity: 0;
left: inherit;
}
1% {
opacity: 0;
}
100% {
opacity: 0;
left: -9999px;
}
}
2020-09-30 15:24:49 +02:00
nav {
2017-10-01 21:55:29 +02:00
a {
color: $default-black;
display: block;
width: 100%;
text-decoration: none;
}
ul::before {
content: "" !important;
}
2020-09-30 15:24:49 +02:00
&>li {
// Navbar
2017-10-01 22:51:43 +02:00
@include blackOnWhite;
2017-10-01 21:55:29 +02:00
margin-left: 0;
2020-09-30 15:24:49 +02:00
&>ul {
// Navbar items
2017-10-01 21:55:29 +02:00
margin: 0;
padding: 0;
display: table-cell;
2017-10-01 21:55:29 +02:00
padding-left: 1ch;
padding-right: 1ch;
2020-09-30 15:24:49 +02:00
@include hoverable($default-white,
$default-blue);
2017-10-01 21:55:29 +02:00
&:focus {
2020-09-30 15:24:49 +02:00
@include whiteOnBlue;
li {
// Display inner items on focus
2017-10-01 21:55:29 +02:00
display: block;
opacity: 1;
left: inherit;
animation-name: hide;
animation-name: none;
}
}
2020-09-30 15:24:49 +02:00
&>li {
// Navbar inner lists
@include blackOnWhite;
position: absolute;
border: 2px solid;
box-shadow: 0 0 0 0.25ch $default-white;
margin-left: calc(2px - 1ch);
margin-right: calc(2px - 1ch);
margin-top: $line-height / 2;
margin-bottom: $line-height / 2;
padding: calc(0.25ch + 2px);
padding-top: $line-height / 2;
padding-bottom: $line-height / 2;
opacity: 0;
left: -9999px;
animation-name: hide;
animation-duration: 0.5s;
&>ul {
// Inner Items
@include blackOnWhite;
padding-left: 1ch;
padding-right: 1ch;
min-height: $line-height;
&:hover {
// Navbar inner items hover
@include whiteOnBlue;
}
}
}
}
2017-10-01 21:55:29 +02:00
}
}
2020-09-30 15:24:49 +02:00
2017-10-01 22:51:43 +02:00
/* Miscallaneous Classes */
2017-10-01 21:55:29 +02:00
.box {
border: $box-border solid $default-white;
margin: 0.5ch;
2017-10-01 22:26:57 +02:00
padding: calc(0.5ch - #{$box-border});
2017-10-01 21:55:29 +02:00
width: auto;
margin-top: $line-height / 2;
2020-09-30 15:24:49 +02:00
margin-bottom: $line-height / 2;
2017-10-01 21:55:29 +02:00
padding-top: $line-height / 2 - $box-border;
padding-bottom: $line-height / 2 - $box-border;
vertical-align: top;
&.inline {
display: inline-block;
}
2017-10-01 21:55:29 +02:00
&.double {
border-style: double;
border-width: $box-double-border;
2017-10-01 22:26:57 +02:00
margin: calc(0.5ch);
padding: calc(0.5ch - (#{$box-double-border}));
2020-09-30 15:24:49 +02:00
margin-top: $line-height / 2;
margin-bottom: $line-height / 2;
2017-10-01 21:55:29 +02:00
padding-top: $line-height / 2 - $box-double-border;
padding-bottom: $line-height / 2 - $box-double-border;
}
&.black {
2017-10-01 22:51:43 +02:00
@include whiteOnBlack;
2017-10-01 21:55:29 +02:00
box-shadow: 0 0 0 0.25ch $default-black;
}
&.white {
2017-10-01 22:51:43 +02:00
@include blackOnWhite;
2017-10-01 21:55:29 +02:00
box-shadow: 0 0 0 0.25ch $default-white;
2017-10-01 22:31:58 +02:00
a {
color: $default-black;
&:hover {
@include whiteOnBlue;
}
}
2017-10-01 21:55:29 +02:00
}
&.blue {
2017-10-01 22:51:43 +02:00
@include whiteOnBlue;
2017-10-01 21:55:29 +02:00
box-shadow: 0 0 0 0.25ch $default-blue;
2020-09-30 15:24:49 +02:00
li.button-list>ul:hover {
2017-10-01 22:51:43 +02:00
@include blackOnWhite;
2017-10-01 22:31:58 +02:00
}
2020-09-30 15:24:49 +02:00
li.button-list>ul:hover>a {
2017-10-01 22:31:58 +02:00
color: $default-black;
}
a:hover {
2017-10-01 22:51:43 +02:00
@include blueOnWhite;
2017-10-01 22:31:58 +02:00
}
hr {
border-color: $default-white;
}
button {
&:hover {
@include blueOnWhite;
}
}
2020-09-30 15:24:49 +02:00
.checkbox-right,
.checkbox-left,
.radio-right,
.radio-left {
&:hover {
@include blueOnWhite;
}
}
2017-10-01 21:55:29 +02:00
}
}
.list-symbol::after {
content: "";
}
.no-select {
user-select: none;
-moz-user-select: none;
-webkit-user-select: none;
}
2020-09-30 15:24:49 +02:00
/* How to add pages:
2017-10-04 01:22:51 +02:00
*
* (at)for (dollar)i from 1 through 20 {
* .page-#{(dollar)i} {
* display: none;
* }
* #radio-page-#{(dollar)i}:checked ~ .page-#{(dollar)i} {
* display: block;
* }
* }
*/
2020-09-30 15:24:49 +02:00
/* Form styles */
2020-09-30 15:24:49 +02:00
input[type=checkbox],
input[type=radio] {
display: none;
}
2020-09-30 15:24:49 +02:00
.checkbox-right,
.checkbox-left,
.radio-right,
.radio-left {
@include hoverable($default-white,
$default-blue);
}
.checkbox-right {
&::after {
content: "[ ]";
}
}
2020-09-30 15:24:49 +02:00
.checkbox-left {
&::before {
content: "[ ]";
}
}
.radio-right {
&::after {
content: "( )";
}
}
2020-09-30 15:24:49 +02:00
.radio-left {
&::before {
content: "( )";
}
}
input[type=checkbox]:checked {
2020-09-30 15:24:49 +02:00
&+.checkbox-right::after {
content: "[x]";
}
2020-09-30 15:24:49 +02:00
&+.checkbox-left::before {
content: "[x]";
}
}
input[type=radio]:checked {
2020-09-30 15:24:49 +02:00
&+.radio-right::after {
content: "(x)";
}
2020-09-30 15:24:49 +02:00
&+.radio-left::before {
content: "(x)";
}
}
2020-09-30 15:24:49 +02:00
input[type=text],
button {
background-color: inherit;
border: none;
font-family: inherit;
font-size: inherit;
color: inherit;
2020-09-30 15:24:49 +02:00
@include hoverable($default-white,
$default-blue);
}
label:hover {
cursor: pointer;
}
button {
2020-09-30 15:24:49 +02:00
&:focus,
&:hover,
&:active,
&::-moz-focus-inner {
border: none;
text-decoration: none;
}
2020-09-30 15:24:49 +02:00
&::before {
content: "[ ";
}
&::after {
content: " ]";
}
}
.textinput {
display: inline-block;
2020-09-30 15:24:49 +02:00
@include hoverable($default-white,
$default-blue);
&::before {
content: "[";
}
&::after {
content: "]";
}
2020-09-30 15:24:49 +02:00
&:hover>input[type=text] {
@include whiteOnBlue;
}
}
input[type=text] {
@include blackOnWhite;
width: 15ch;
}
2020-09-30 15:24:49 +02:00
2017-10-01 22:51:43 +02:00
/* Style helpers, like space-takers */
2017-10-01 22:20:12 +02:00
@for $i from 1 through 5 {
2020-09-30 15:24:49 +02:00
.space-#{$i} {
min-height: $line-height * $i;
}
2017-10-01 22:20:12 +02:00
}
@for $width from 1 through 5 {
2020-09-30 15:24:49 +02:00
.width-#{$width * 5} {
width: $width * 5ch;
}
2017-10-01 22:20:12 +02:00
}
2020-09-30 15:24:49 +02:00
2017-10-01 22:20:12 +02:00
@for $width from 1 through 5 {
2020-09-30 15:24:49 +02:00
.width-#{$width * 50} {
width: $width * 50ch - 2ch;
}
2017-10-01 22:20:12 +02:00
}
@for $i from 1 through 5 {
2020-09-30 15:24:49 +02:00
.padding-#{$i} {
padding: $i * 1ch;
padding-top: $line-height * $i;
padding-bottom: $line-height * $i;
}
}