rename(styles): index to globals and add new styles

This commit is contained in:
wanhose 2021-04-11 11:42:36 +02:00
parent 4fe35d116c
commit 83a1a7fb22
3 changed files with 277 additions and 97 deletions

27
styles/fonts.css Normal file
View File

@ -0,0 +1,27 @@
@font-face {
font-family: "Lato";
font-style: normal;
font-weight: 400;
src: url("/assets/fonts/Lato-Regular.ttf") format("truetype");
}
@font-face {
font-family: "Lato";
font-style: italic;
font-weight: 400;
src: url("/assets/fonts/Lato-Italic.ttf") format("truetype");
}
@font-face {
font-family: "Lato";
font-style: normal;
font-weight: 700;
src: url("/assets/fonts/Lato-Bold.ttf") format("truetype");
}
@font-face {
font-family: "Lato";
font-style: italic;
font-weight: 700;
src: url("/assets/fonts/Lato-BoldItalic.ttf") format("truetype");
}

250
styles/globals.css Normal file
View File

@ -0,0 +1,250 @@
/* Globals */
:root {
--color-chocolate: #47321e;
--color-cookie: #f2e9df;
--color-error: #cc0000;
--color-success: #5cb85c;
--color-white: #ffffff;
}
a {
color: var(--color-star);
display: inline-block;
}
body {
color: var(--color-chocolate);
display: flex;
flex-direction: column;
font-family: "Lato", Arial, Helvetica, sans-serif;
height: 25rem;
width: 20rem;
}
button {
background-color: transparent;
border: none;
cursor: pointer;
padding: 0;
margin: 0;
}
button:focus {
outline: none;
}
span {
display: inline-block;
}
strong {
font-weight: bold;
}
svg {
height: 1rem;
width: 1rem;
}
/* Header */
.header {
align-items: center;
background-color: var(--color-cookie);
display: flex;
font-size: 1rem;
font-weight: bold;
height: 3rem;
justify-content: space-between;
padding: 0 1rem;
}
.header-actions {
align-items: center;
display: flex;
}
.header-actions > button {
border-radius: 0.125rem;
color: var(--color-chocolate);
padding: 0.25rem;
transition: 0.4s;
}
.header-actions > button:focus,
.header-actions > button:hover {
background-color: var(--color-chocolate);
color: var(--color-cookie);
}
.header-title {
font-size: 1rem;
font-weight: bold;
margin: 0;
}
/* Main */
main {
display: flex;
flex-direction: column;
padding: 1rem;
}
/* Footer */
footer {
border-top: 0.0625rem solid var(--color-cookie);
font-size: 0.75rem;
margin-top: auto;
padding: 1rem;
text-align: center;
}
/* Help */
.help {
align-items: center;
display: flex;
justify-content: space-between;
}
.help > a {
padding: 0.25rem;
text-decoration: none;
transition: 0.4s;
}
.help > a:focus,
.help > a:hover {
background-color: var(--color-chocolate);
border-radius: 0.125rem;
color: var(--color-cookie);
outline: none;
}
.help > span {
font-size: 0.875rem;
}
/* Rating */
#like,
#unlike {
color: var(--color-chocolate);
cursor: pointer;
padding: 0.25rem;
transition: 0.4s;
}
#like:focus,
#like:hover {
color: var(--color-success);
}
#negative,
#positive {
background-color: var(--color-cookie);
border-radius: 0.125rem;
font-size: 0.75rem;
line-height: 1rem;
margin-bottom: 0;
margin-top: 1rem;
padding: 1rem;
}
.rating {
align-items: center;
display: flex;
justify-content: space-between;
}
.rating > span {
font-size: 0.875rem;
}
.rating-actions {
align-items: center;
display: flex;
}
.rating-actions > button {
margin-left: 1rem;
}
#unlike:focus,
#unlike:hover {
color: var(--color-error);
}
/* Separator */
.separator {
border-bottom: 0.0625rem solid var(--color-cookie);
height: 0;
margin-bottom: 1rem;
margin-top: 1rem;
}
/* Switch */
.switch {
display: inline-block;
flex-shrink: 0;
height: 1.25rem;
margin-left: 0.75rem;
position: relative;
width: 2.5rem;
}
.switch input {
height: 0;
opacity: 0;
width: 0;
}
.switch-label {
cursor: pointer;
display: flex;
font-size: 0.875rem;
justify-content: space-between;
}
.switch-label > span {
line-height: 1.25rem;
}
.slider {
background-color: var(--color-cookie);
bottom: 0;
cursor: pointer;
left: 0;
position: absolute;
right: 0;
top: 0;
transition: 0.4s;
}
.slider:before {
background-color: var(--color-white);
bottom: 0.25rem;
content: "";
height: 0.75rem;
left: 0.25rem;
position: absolute;
transition: 0.4s;
width: 0.75rem;
}
input:checked + .slider {
background-color: var(--color-chocolate);
}
input:focus + .slider {
box-shadow: 0 0 0.0625rem var(--color-chocolate);
}
input:checked + .slider:before {
transform: translateX(1.25rem);
}

View File

@ -1,97 +0,0 @@
:root {
--color-chocolate: #47321e;
--color-cookie: #f2e9df;
--color-star: #e0a261;
}
a {
color: var(--color-star);
display: inline-block;
}
body {
align-items: center;
background-color: var(--color-cookie);
color: var(--color-chocolate);
display: flex;
flex-direction: column;
height: 12rem;
justify-content: center;
margin: 1rem;
width: 20rem;
}
h1 {
font-size: 1.125rem;
font-weight: 500;
line-height: 1;
margin-bottom: 1rem;
margin-top: 0;
text-align: center;
}
span {
display: inline-block;
}
#negative,
#positive {
font-size: 1rem;
line-height: 1;
margin: 0;
text-align: center;
}
.star {
fill: none;
height: 1.5rem;
outline: none;
stroke: var(--color-star);
width: 1.5rem;
}
.star:hover {
cursor: pointer;
}
.star:not(:last-child) {
padding-right: 0.75rem;
}
#state-button {
background-color: var(--color-star);
border: none;
border-radius: 0.25rem;
color: var(--color-chocolate);
font-size: 0.875rem;
line-height: 1;
margin: 0 auto 1rem auto;
outline: 0;
padding: 0.5rem 1rem;
}
#state-button:focus,
#state-button:hover {
cursor: pointer;
opacity: 0.7;
}
#stars {
display: inline-flex;
}
#stars:hover .star {
fill: var(--color-star);
}
#stars:hover .star:hover ~ .star {
fill: none;
}
#stars .star {
fill: none;
}
#stars[hidden="true"] {
display: none;
}