nexmoe.css
Version:
Use only HTML to write modern websites with smooth animations and beautiful interfaces.
476 lines (395 loc) • 8.09 kB
CSS
/* Nexmoe.css - https://github.com/nexmoe/nexmoe.css */
/* Variables */
:root {
--active-brightness: 0.8;
--hover-brightness: 1.2;
--border-radius: 6px;
--color-primary: rgb(23, 23, 23);
--color-link: #df5d64;
--color-text: rgb(23, 23, 23);
--color-bg: #fff;
--color-hover: rgba(23, 23, 23, 0.15);
--nexmoe-gap: 1rem;
--icon-checkbox: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23FFF' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
--icon-summary: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(23, 23, 23)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}
@media (prefers-color-scheme: dark) {
:root {
--color-primary: #fff;
--color-text: #f7f7f7;
--color-bg: #111;
--color-hover: rgba(230, 230, 230, 0.15);
--icon-checkbox: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
--icon-summary: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23f7f7f7' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}
}
* {
box-sizing: border-box;
}
/* Layout */
body {
margin: 0;
background-color: var(--color-bg);
color: var(--color-text);
line-height: 1.5;
padding: 0 3rem;
}
@media (max-width: 768px) {
body {
padding: 0 1rem;
}
}
header {
text-align: center;
line-height: 1.7;
}
header h2 {
border-bottom: none;
}
footer {
padding: 2rem 0;
}
@media (max-width: 768px) {
footer {
padding: 2rem 1rem;
}
}
main {
max-width: 960px;
margin: 50px auto;
padding: 0 1rem;
}
section {
margin: 4rem 0;
}
article {
border-radius: var(--border-radius);
overflow: hidden;
border: 2px solid var(--color-text);
box-shadow: 0 4px 7px 1px rgba(0, 0, 0, 0.25);
}
article > *:first-child {
margin-top: 0;
}
article > *:last-child {
margin-bottom: 0;
}
/* Typography */
a {
color: var(--color-link);
text-decoration: none;
}
a:hover {
text-decoration: underline;
filter: brightness(var(--hover-brightness));
}
a:active {
filter: brightness(var(--active-brightness));
}
h1 {
font-size: 2.7rem;
}
h2 {
font-size: 2rem;
}
h3 {
font-size: 1.5rem;
}
h4 {
font-size: 1.17rem;
}
h5 {
font-size: 1rem;
}
h6 {
font-size: 0.83rem;
}
mark {
padding: 0 0.25rem;
}
img {
border-radius: var(--border-radius);
box-shadow: 0 0 0 1px #eee;
}
p {
margin: 1rem 0;
}
kbd {
color: var(--color-text);
border: 1px solid var(--color-text);
border-bottom: 3px solid var(--color-text);
border-radius: 5px;
padding: 0.3rem 0.55rem;
}
hr {
border: none;
border-top: 2px solid #ccc;
margin: 1rem 0;
}
blockquote {
border-left: 6px solid;
padding: 1px 2rem;
}
code {
padding: 0.2em 0.4em;
margin: 0;
font-size: 85%;
background-color: rgba(175, 184, 193, 0.2);
border-radius: 6px;
}
/* Other */
details summary::marker {
content: none;
}
details summary::after {
display: block;
width: 1rem;
height: 1rem;
margin-top: 0.25rem;
float: right;
transform: rotate(-90deg);
background-image: var(--icon-summary);
background-position: right center;
background-size: 1rem auto;
background-repeat: no-repeat;
content: "";
transition: transform 0.2s ease-in-out;
}
details[open] summary::after {
transform: rotate(0deg);
}
details summary {
padding: 1rem;
}
details + div {
max-height: 0;
overflow: hidden;
padding: 0 1rem;
opacity: 0;
transition: max-height 0.2s ease-in-out;
}
details[open] + div {
max-height: 1000px;
opacity: 1;
border-top: 2px solid var(--color-text);
}
input[type="radio"],
input[type="checkbox"],
label,
details {
cursor: pointer;
}
label > input:not([type="checkbox"]):not([type="radio"]),
label > select {
display: block;
margin-top: 0.3em;
}
dialog {
box-shadow: 0px 25px 50px -12px rgba(0, 0, 0, 0.25);
border: none;
border-radius: var(--border-radius);
padding: calc(var(--nexmoe-gap) * 1.5);
background-color: var(--color-bg);
color: var(--color-text);
animation-name: dialogScaleIn;
animation-duration: 0.2s;
}
@keyframes dialogScaleIn {
from {
transform: scale(0.5, 0.5);
}
to {
transform: scale(1, 1);
}
}
dialog menu {
display: flex;
gap: var(--nexmoe-gap);
justify-content: flex-end;
margin-bottom: 0;
}
dialog fieldset {
border: 0;
margin: unset;
padding: unset;
}
dialog fieldset legend {
font-size: 1.5rem;
margin-bottom: var(--nexmoe-gap);
}
/* Form */
button:active,
input:active {
transform: translateY(2px);
transition: transform 0.1s;
}
input[type="checkbox"],
input[type="radio"] {
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
width: 1.25rem;
height: 1.25rem;
margin-top: 0;
margin-right: 0.3rem;
margin-left: 0;
vertical-align: middle;
padding: 0;
}
input[type="checkbox"]:checked,
input[type="radio"]:checked {
background-image: var(--icon-checkbox);
background-position: center;
background-size: 0.75em auto;
background-repeat: no-repeat;
background-color: var(--color-primary);
}
input[type="radio"] {
border-radius: 50%;
}
button,
input[type="button"],
input[type="submit"],
input[type="reset"] {
cursor: pointer;
background-color: var(--color-primary);
color: var(--color-bg);
}
button,
input,
select {
transition: all 0.1s ease-in-out;
}
button:hover,
input:hover,
select:hover,
textarea:hover {
box-shadow: 0 0 0 2px var(--color-hover);
}
button,
input,
select,
textarea {
font-size: 1.2rem;
border: 2px solid var(--color-primary);
border-radius: var(--border-radius);
padding: 0.6rem 1rem;
}
button[text] {
background-color: transparent;
color: var(--color-primary);
border-color: transparent;
}
input[type="color"] {
padding: 1px 4px;
}
/* Nav */
nav {
align-items: center;
display: flex;
justify-content: space-between;
margin: 1rem 0;
font-size: 1.2rem;
}
@media (max-width: 768px) {
nav {
margin: 1rem;
flex-wrap: wrap;
flex-direction: column;
}
nav ul {
text-align: center;
}
}
nav > a {
font-size: 1.5rem;
}
nav a {
color: var(--color-text);
display: block;
}
nav ul {
list-style: none;
padding: 0;
margin: -0.2rem;
}
nav ul li {
display: inline-block;
position: relative;
margin: 0.2rem;
}
nav ul li a {
min-width: 2rem;
padding: 0.5rem 1rem;
border-radius: 30px;
transition: background-color 0.1s ease-in-out;
}
nav ul li a:hover {
color: var(--color-primary);
background-color: var(--color-hover);
text-decoration: none;
filter: unset;
}
nav ul li a[checked],
nav ul li a:active {
transition: none;
background-color: var(--color-primary);
color: var(--color-bg);
}
/* Nav Dropdown */
nav ul li ul {
background: var(--color-bg);
border-radius: var(--border-radius);
box-shadow: 0 1px 5px rgba(100, 100, 100, 0.15);
height: auto;
padding: 1rem 0.8rem;
position: absolute;
top: 3.5rem;
white-space: nowrap;
width: auto;
min-width: 100%;
transform: translateY(-8px);
z-index: -1;
opacity: 0;
transition: all 0.2s ease-in-out;
}
nav ul li:hover ul {
z-index: 1;
opacity: 1;
transform: translateY(0);
}
nav ul li ul::before {
content: "";
position: absolute;
left: 0;
right: 0;
top: -0.5rem;
height: 0.5rem;
}
nav ul li ul li {
display: block;
}
nav ul li ul li a {
border-radius: var(--border-radius);
}
/* Table */
table {
font-size: 1.2rem;
border-collapse: collapse;
}
th,
td {
padding: 0.6em 1.2em;
text-align: left;
}
th {
background-color: var(--color-primary);
color: var(--color-bg);
}
tr:nth-child(even) {
background-color: #f2f2f2;
}
tr:hover {
background-color: #f5f5f5;
}
/*# sourceMappingURL=nexmoe.css.map */