Made the scss a bit neater, added forms and pages

This commit is contained in:
Teascade 2017-10-03 23:12:15 +00:00
parent ff87ef6aa7
commit ac84a23f00
4 changed files with 430 additions and 90 deletions

View File

@ -1,74 +1,96 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS example</title>
<link type="text/css" rel="stylesheet" href="style.css" />
</head>
<body>
<nav>
<li>
<ul>GFA.EXE</ul><ul tabindex="0" class="list-symbol">File
<li>
<ul>Save</ul>
<ul>Save As</ul>
<ul>Exit</ul>
</li>
</ul><ul tabindex="0" class="list-symbol">Edit
<li>
<ul>Scale</ul>
<ul>Something</ul>
<head>
<meta charset="utf-8">
<title>CSS example</title>
<link type="text/css" rel="stylesheet" href="style.css" />
</head>
<body>
<input type="radio" id="radio-page-1" name="pages">
<input type="radio" id="radio-page-2" name="pages">
<nav>
<li>
<ul>GFA.EXE</ul><ul tabindex="0" class="list-symbol">File
<li>
<ul>Save</ul>
<ul>Save As</ul>
<ul>Exit</ul>
</li>
</ul><ul tabindex="0" class="list-symbol">Edit
<li>
<ul>Scale</ul>
<ul>Something</ul>
</li></ul><ul tabindex="0" class="list-symbol">View
<li>
<ul>Style</ul>
<ul>Another style</ul>
</li></ul><ul tabindex="0" class="list-symbol">Help
<li>
<ul><a href="https://git.teasca.de/teascade/retrofuturistic-universe">What is this?</a></ul>
<ul><a href="https://git.teasca.de/teascade/retrofuturistic-universe/issues">Oh no</a></ul>
<ul><hr></ul>
<ul>A thing under hr</ul>
</li></ul>
</li>
</nav>
<div class=""></div>
<p>Good day! <b>Bold!</b></p>
<div>
<div class="box white width-50">
<p><b>Links!</b></p>
<li class="button-list">
<ul><a href="https://teasca.de/">Teasca.de</a></ul>
<ul><a href="https://github.com/teascade">GitHub</a></ul>
<ul><a href="https://social.targaryen.house/@teascade">Mastodon</a></ul>
</li></ul><ul tabindex="0" class="list-symbol">Pages
<li>
<ul><label for="radio-page-1">Page 1</label></ul>
<ul><label for="radio-page-2">Page 2</label></ul>
</li></ul><ul tabindex="0" class="list-symbol">Help
<li>
<ul><a href="https://git.teasca.de/teascade/retrofuturistic-universe">What is this?</a></ul>
<ul><a href="https://git.teasca.de/teascade/retrofuturistic-universe/issues">Oh no</a></ul>
<ul><hr></ul>
<ul>A thing under hr</ul>
</li></ul>
</li>
<div class="hr"><hr></div>
<p>Stuff under the hr!</p>
</li>
</div
><div class="box double white width-50">
<p>Welcome to a thing! This is a list, hello!</p>
<p>The list:</p>
<li>
<ul>Thing in a list </ul>
<ul>Another thing</ul>
</li>
<div class="space-1em"></div>
</div>
</div>
<div>
<div class="box blue width-100">
<div class="padding-1">
<div class="">
<p>Dolorem iusto nihil modi perspiciatis. Omnis nemo sed nam sed sunt qui. Laudantium accusantium architecto sint et necessitatibus quibusdam. Doloribus hic similique ut reiciendis rem ut placeat. Sit doloremque autem dicta quasi commodi nihil qui.</p>
<div class="space-1em"></div>
<p><b>Some stuff</b></p>
<div class="space-1em"></div>
<p>This is a blue box</p>
<div class="hr"><hr></div>
<p>Hello! I'm under hr!</p>
</nav>
<div class="page-1">
<p>Good day! <b>Bold!</b></p>
<div>
<div class="box white width-50">
<p><b>Links!</b></p>
<li class="button-list">
<ul><a href="https://teasca.de/">Teasca.de</a></ul>
<ul><a href="https://github.com/teascade">GitHub</a></ul>
<ul><a href="https://social.targaryen.house/@teascade">Mastodon</a></ul>
</li>
<div class="hr"><hr></div>
<p>Stuff under the hr!</p>
</li>
</div
><div class="box double white width-50">
<p>Welcome to a thing! This is a list, hello!</p>
<p>The list:</p>
<li>
<ul>Thing in a list </ul>
<ul>Another thing</ul>
</li>
<div class="space-1em"></div>
</div>
</div>
<div>
<div class="box blue width-100">
<div class="padding-1">
<div class="">
<p>Dolorem iusto nihil modi perspiciatis. Omnis nemo sed nam sed sunt qui. Laudantium accusantium architecto sint et necessitatibus quibusdam. Doloribus hic similique ut reiciendis rem ut placeat. Sit doloremque autem dicta quasi commodi nihil qui.</p>
<div class="space-1em"></div>
<p><b>Some stuff</b></p>
<div class="space-1em"></div>
<p>This is a blue box</p>
<div class="hr"><hr></div>
<p>Hello! I'm under hr!</p>
</div>
</div>
</div>
</div>
<div>
<div class="box white width-100">
<div class="padding-1">
<b>A test form!</b>
<p>Name: <label for="name" class="textinput"><input type="text" id="name"></label></p>
<p><input type="checkbox" id="checkbox"><label class="checkbox-right no-select" for="checkbox"> Yes or no? </label></p>
<p><input type="radio" id="radio1" name="radio"><label for="radio1" class="radio-right no-select"> Radiobutton 1 </label></p>
<p><input type="radio" id="radio2" name="radio"><label for="radio2" class="radio-right no-select"> Radiobutton 2 </label></p>
<p><button name="button" label="button">Button</button></p>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
<div class="page-2">
<p>Hello! Welcome to <b>Page 2</b></p>
</div>
</body>
</html>

218
style.css
View File

@ -28,9 +28,9 @@ ul {
a {
color: #c9c9c9; }
a:hover {
background-color: #171c94;
cursor: pointer;
color: #c9c9c9;
border-color: #c9c9c9; }
background-color: #171c94; }
nav ul > li > ul:hover a {
color: #c9c9c9; }
@ -53,13 +53,12 @@ nav > li > ul li > ul:hover > hr, li.button-list > ul:hover a hr {
li:not(.button-list) > ul::before {
content: "- "; }
li.button-list > ul {
width: calc(100% - 1ch); }
width: calc(100% - 1ch);
text-decoration: underline; }
li.button-list > ul:hover {
background-color: #171c94;
color: #c9c9c9;
border-color: #c9c9c9; }
li.button-list > ul:hover > a {
color: #c9c9c9; }
li.button-list > ul > li {
width: 100%; }
li.button-list > ul a {
@ -95,10 +94,9 @@ nav > li {
padding-left: 1ch;
padding-right: 1ch; }
nav > li > ul:hover {
background-color: #171c94;
cursor: pointer;
color: #c9c9c9;
border-color: #c9c9c9;
cursor: pointer; }
background-color: #171c94; }
nav > li > ul:focus {
background-color: #171c94;
color: #c9c9c9;
@ -197,10 +195,214 @@ nav > li {
border-color: #171c94; }
.box.blue hr {
border-color: #c9c9c9; }
.box.blue button:hover {
background-color: #c9c9c9;
color: #171c94;
border-color: #171c94; }
.box.blue .checkbox-right:hover, .box.blue .checkbox-left:hover, .box.blue .radio-right:hover, .box.blue .radio-left:hover {
background-color: #c9c9c9;
color: #171c94;
border-color: #171c94; }
.list-symbol::after {
content: " ▼"; }
.no-select {
user-select: none;
-moz-user-select: none;
-webkit-user-select: none; }
.page-1 {
display: none; }
#radio-page-1:checked ~ .page-1 {
display: block; }
.page-2 {
display: none; }
#radio-page-2:checked ~ .page-2 {
display: block; }
.page-3 {
display: none; }
#radio-page-3:checked ~ .page-3 {
display: block; }
.page-4 {
display: none; }
#radio-page-4:checked ~ .page-4 {
display: block; }
.page-5 {
display: none; }
#radio-page-5:checked ~ .page-5 {
display: block; }
.page-6 {
display: none; }
#radio-page-6:checked ~ .page-6 {
display: block; }
.page-7 {
display: none; }
#radio-page-7:checked ~ .page-7 {
display: block; }
.page-8 {
display: none; }
#radio-page-8:checked ~ .page-8 {
display: block; }
.page-9 {
display: none; }
#radio-page-9:checked ~ .page-9 {
display: block; }
.page-10 {
display: none; }
#radio-page-10:checked ~ .page-10 {
display: block; }
.page-11 {
display: none; }
#radio-page-11:checked ~ .page-11 {
display: block; }
.page-12 {
display: none; }
#radio-page-12:checked ~ .page-12 {
display: block; }
.page-13 {
display: none; }
#radio-page-13:checked ~ .page-13 {
display: block; }
.page-14 {
display: none; }
#radio-page-14:checked ~ .page-14 {
display: block; }
.page-15 {
display: none; }
#radio-page-15:checked ~ .page-15 {
display: block; }
.page-16 {
display: none; }
#radio-page-16:checked ~ .page-16 {
display: block; }
.page-17 {
display: none; }
#radio-page-17:checked ~ .page-17 {
display: block; }
.page-18 {
display: none; }
#radio-page-18:checked ~ .page-18 {
display: block; }
.page-19 {
display: none; }
#radio-page-19:checked ~ .page-19 {
display: block; }
.page-20 {
display: none; }
#radio-page-20:checked ~ .page-20 {
display: block; }
/* Form styles */
input[type=checkbox], input[type=radio] {
display: none; }
.checkbox-right:hover, .checkbox-left:hover, .radio-right:hover, .radio-left:hover {
cursor: pointer;
color: #c9c9c9;
background-color: #171c94; }
.checkbox-right::after {
content: "[ ]"; }
.checkbox-left::before {
content: "[ ]"; }
.radio-right::after {
content: "( )"; }
.radio-left::before {
content: "( )"; }
input[type=checkbox]:checked + .checkbox-right::after {
content: "[x]"; }
input[type=checkbox]:checked + .checkbox-left::before {
content: "[x]"; }
input[type=radio]:checked + .radio-right::after {
content: "(x)"; }
input[type=radio]:checked + .radio-left::before {
content: "(x)"; }
input[type=text], button {
background-color: inherit;
border: none;
font-family: inherit;
font-size: inherit;
color: inherit; }
input[type=text]:hover, button:hover {
cursor: pointer;
color: #c9c9c9;
background-color: #171c94; }
button:focus, button:hover, button:active, button::-moz-focus-inner {
border: none;
text-decoration: none; }
button::before {
content: "[ "; }
button::after {
content: " ]"; }
.textinput {
display: inline-block; }
.textinput:hover {
cursor: pointer;
color: #c9c9c9;
background-color: #171c94; }
.textinput::before {
content: "["; }
.textinput::after {
content: "]"; }
.textinput:hover > input[type=text] {
background-color: #171c94;
color: #c9c9c9;
border-color: #c9c9c9; }
input[type=text] {
background-color: #c9c9c9;
color: black;
border-color: black;
width: 15ch; }
/* Style helpers, like space-takers */
.space-1em {
min-height: 21px; }

File diff suppressed because one or more lines are too long

View File

@ -32,6 +32,14 @@ $box-double-border: 4px;
border-color: $default-black;
}
@mixin hoverable($hoverFg, $hoverBg) {
&:hover {
cursor: pointer;
color: $hoverFg;
background-color: $hoverBg;
}
}
:root { // Styles applying to everyting
font-family: "Iosevka Slab", "Iosevka", "Consolas", "monospace";
@ -67,9 +75,7 @@ ul {
a {
color: $default-white;
&:hover {
@include whiteOnBlue;
}
@include hoverable($default-white, $default-blue);
}
nav ul > li > ul:hover a {
@ -99,13 +105,10 @@ li {
}
&.button-list > ul {
width: calc(100% - 1ch);
text-decoration: underline;
&:hover {
@include whiteOnBlue;
& > a {
color: $default-white;
}
}
& > li {
@ -157,11 +160,8 @@ nav {
display: inline-block;
padding-left: 1ch;
padding-right: 1ch;
@include hoverable($default-white, $default-blue);
&:hover { // Navbar items
@include whiteOnBlue;
cursor: pointer;
}
&:focus {
@include whiteOnBlue;
@ -250,11 +250,11 @@ nav {
box-shadow: 0 0 0 0.25ch $default-white;
a {
color: $default-black;
&:hover {
@include whiteOnBlue;
}
}
color: $default-black;
&:hover {
@include whiteOnBlue;
}
}
}
&.blue {
@ -273,6 +273,16 @@ nav {
hr {
border-color: $default-white;
}
button {
&:hover {
@include blueOnWhite;
}
}
.checkbox-right, .checkbox-left, .radio-right, .radio-left {
&:hover {
@include blueOnWhite;
}
}
}
}
@ -280,6 +290,112 @@ nav {
content: "";
}
.no-select {
user-select: none;
-moz-user-select: none;
-webkit-user-select: none;
}
@for $i from 1 through 20 {
.page-#{$i} {
display: none;
}
#radio-page-#{$i}:checked ~ .page-#{$i} {
display: block;
}
}
/* Form styles */
input[type=checkbox], input[type=radio] {
display: none;
}
.checkbox-right, .checkbox-left, .radio-right, .radio-left {
@include hoverable($default-white, $default-blue);
}
.checkbox-right {
&::after {
content: "[ ]";
}
}
.checkbox-left {
&::before {
content: "[ ]";
}
}
.radio-right {
&::after {
content: "( )";
}
}
.radio-left {
&::before {
content: "( )";
}
}
input[type=checkbox]:checked {
& + .checkbox-right::after {
content: "[x]";
}
& + .checkbox-left::before {
content: "[x]";
}
}
input[type=radio]:checked {
& + .radio-right::after {
content: "(x)";
}
& + .radio-left::before {
content: "(x)";
}
}
input[type=text], button {
background-color: inherit;
border: none;
font-family: inherit;
font-size: inherit;
color: inherit;
@include hoverable($default-white, $default-blue);
}
button {
&:focus, &:hover, &:active, &::-moz-focus-inner {
border: none;
text-decoration: none;
}
&::before { content: "[ "; }
&::after { content: " ]"; }
}
.textinput {
display: inline-block;
@include hoverable($default-white, $default-blue);
&::before {
content: "[";
}
&::after {
content: "]";
}
&:hover > input[type=text] {
@include whiteOnBlue;
}
}
input[type=text] {
@include blackOnWhite;
width: 15ch;
}
/* Style helpers, like space-takers */
@for $i from 1 through 5 {