misskey-tools/styles/_xeltica-design.scss

501 lines
8.6 KiB
SCSS
Raw Normal View History

2020-08-04 12:13:41 +09:00
/*
Xeltica Design CSS Framework
(C)2020 Xeltica
*/
* {
box-sizing: border-box;
line-height: 1.8em;
}
html {
2021-01-06 11:39:37 +09:00
$primary: rgb(134, 179, 0);
$fg: rgba(255, 255, 255, 0.8);
$bg: rgba(24, 24, 24, 0.8);
$overlay: transparentize($bg, 0.5);
$danger: #c72c2c;
2020-08-04 12:13:41 +09:00
font-size: 18px;
@media screen and (max-width: 640px) {
font-size: 15px;
}
2021-01-06 11:39:37 +09:00
--primary: #{$primary};
--primary-light: #{lighten($primary, 5%)};
--primary-dark: #{darken($primary, 5%)};
--primary-fg: white;
--bg: #{$bg};
--bg-pale-1: #{darken($bg, 5%)};
--bg-pale-2: #{darken($bg, 10%)};
--overlay: #{$overlay};
--fg: #{$fg};
// --divider: rgba(70, 70, 70, 0.25);
--radius: 0px;
--margin: 16px;
--bg-danger: #{$danger};
--fg-danger: white;
--divider-danger: #400e0e;
--bg-danger-lighten: #{lighten($danger, 5%)};
--bg-danger-darken: #{darken($danger, 5%)};
2020-08-04 12:13:41 +09:00
}
body {
2021-01-06 11:39:37 +09:00
background: var(--bg);
color: var(--fg);
2020-08-04 12:13:41 +09:00
}
h1, h2, h3, h4, h5, h6 {
font-weight: normal;
margin: 0;
margin-bottom: 8px;
}
dl {
margin: 0;
> dt {
font-weight: bold;
}
> dd {
margin-left: 2rem;
@media screen and (max-width: 640px) {
margin-left: 0;
}
}
}
h1 { font-size: 2.5rem; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.4rem; }
h4 { font-size: 1.2rem; }
h5 { font-size: 1.1rem; }
h6 { font-size: 1.05rem; }
input.xd-input {
outline: none;
2021-01-06 11:39:37 +09:00
border-radius: var(--radius);
color: var(--fg);
2020-08-04 12:13:41 +09:00
background: transparent;
2021-01-06 11:39:37 +09:00
border: 1px solid var(--fg);
2020-08-04 12:13:41 +09:00
padding: 2px 8px;
font-size: 1rem;
&:focus {
2021-01-06 11:39:37 +09:00
border-color: var(--primary);
2020-08-04 12:13:41 +09:00
}
}
p {
margin: 1em 0;
&:first-child {
margin-top: 0;
}
}
.xd-inputs {
display: flex;
> *:not(:first-child) {
border-left: none;
border-top-left-radius: 0;
border-bottom-left-radius: 0;
}
> *:not(:last-child) {
border-top-right-radius: 0;
border-bottom-right-radius: 0;
}
}
.xd-main {
2021-01-06 11:39:37 +09:00
background: var(--bg);
2020-08-04 12:13:41 +09:00
padding: 32px;
2021-01-06 11:39:37 +09:00
border-radius: var(--radius);
border: 1px solid var(--divider);
2020-08-04 12:13:41 +09:00
max-width: 960px;
margin: 24px auto;
2021-01-06 11:39:37 +09:00
backdrop-filter: blur(32px) saturate(4);
-webkit-backdrop-filter: blur(32px) saturate(4);
box-shadow: 0 0 16px black;
2020-08-04 12:13:41 +09:00
}
button, .xd-button {
display: flex;
2021-01-06 11:39:37 +09:00
color: var(--fg);
background: var(--bg);
border: 1px solid var(--bg-pale-1);
2020-08-04 12:13:41 +09:00
align-items: center;
justify-content: center;
2021-01-06 11:39:37 +09:00
border-radius: var(--radius);
2020-08-04 12:13:41 +09:00
font-size: 1rem;
outline: none;
padding: 2px 8px;
text-decoration: none;
cursor: pointer;
2021-01-06 22:47:18 +09:00
&:hover, &:focus {
2021-01-06 11:39:37 +09:00
background: var(--bg-pale-1);
2020-08-04 12:13:41 +09:00
}
&:active {
2021-01-06 11:39:37 +09:00
background: var(--bg-pale-2);
2020-08-04 12:13:41 +09:00
}
&.primary {
2021-01-06 11:39:37 +09:00
background: var(--primary);
color: var(--primary-fg);
border-color: var(--primary-dark);
2021-01-06 22:47:18 +09:00
&:hover, &:focus {
2021-01-06 11:39:37 +09:00
background: var(--primary-light);
2020-08-04 12:13:41 +09:00
}
&:active {
2021-01-06 11:39:37 +09:00
background: var(--primary-dark);
2020-08-04 12:13:41 +09:00
}
}
&.danger {
2021-01-06 11:39:37 +09:00
background: var(--bg-danger);
color: white;
border-color: var(--divider-danger);
2021-01-06 22:47:18 +09:00
&:hover, &:focus {
2021-01-06 11:39:37 +09:00
background: var(--bg-danger-lighten);
}
&:active {
2021-01-06 11:39:37 +09:00
background: var(--bg-danger-lighten);
}
}
2020-08-04 12:13:41 +09:00
}
2021-01-06 22:47:18 +09:00
textarea {
width: 100%;
font-size: 1rem;
padding: 16px;
border-radius: var(--radius);
background: var(--overlay);
border: none;
outline: none;
height: 8rem;
2021-01-06 23:50:42 +09:00
line-height: 1.2;
color: var(--fg);
2021-01-06 22:47:18 +09:00
&:focus {
border: 1px solid var(--primary);
}
}
2020-08-04 12:13:41 +09:00
// ul, ol {
// > ul, > ol {
// margin-bottom: 0;
// }
// }
a, .link {
text-decoration: none;
2021-01-06 11:39:37 +09:00
color: var(--primary);
2020-08-04 12:13:41 +09:00
&:hover {
opacity: 0.7;
}
}
table {
2021-01-06 11:39:37 +09:00
border: 1px solid var(--divider);
border-radius: var(--radius);
background: var(--overlay);
width: 100%;
> thead {
2021-01-06 11:39:37 +09:00
background: var(--overlay);
margin-bottom: 2px;
text-align: left;
}
> tbody > tr {
2021-01-06 11:39:37 +09:00
border-bottom: 1px solid var(--overlay);
}
th, td {
padding: 4px 8px;
}
}
2020-08-04 12:13:41 +09:00
code {
2021-01-06 11:39:37 +09:00
border-radius: var(--radius);
2020-08-04 12:13:41 +09:00
color: #0f0;
background: #000;
padding: 8px;
}
.xd-container {
2021-01-06 11:39:37 +09:00
max-width: 960px;
margin: 64px auto;
}
.xd-hstack {
display: flex;
> *:not(:last-child) {
margin-right: var(--margin);
}
> * {
width: 100%;
}
@media screen and (max-width: 640px) {
flex-direction: column;
> * {
margin-bottom: var(--margin);
}
}
}
.xd-vstack {
display: flex;
flex-direction: column;
> *:not(:last-child) {
margin-bottom: var(--margin);
}
2020-08-04 12:13:41 +09:00
}
.xd-card {
2021-01-06 11:39:37 +09:00
background: var(--bg);
padding: 16px;
border-radius: var(--radius);
border: 1px solid var(--divider);
// backdrop-filter: blur(32px) saturate(4);
// -webkit-backdrop-filter: blur(32px) saturate(4);
box-shadow: 0 0 16px black;
2020-08-04 12:13:41 +09:00
overflow: hidden;
2021-01-06 11:39:37 +09:00
2020-08-04 12:13:41 +09:00
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.3rem; }
h4 { font-size: 1.17rem; }
h5 { font-size: 1.12rem; }
h6 { font-size: 1.08rem; }
> .media {
width: 100%;
height: auto;
object-fit: cover;
}
> .body {
padding: 16px;
}
> .header, > .footer {
padding: 8px 16px;
}
> .header {
> h1.title {
2021-01-06 11:39:37 +09:00
font-size: 1.5rem;
2020-08-04 12:13:41 +09:00
margin: 0;
font-weight: bold;
}
}
> .footer {
2021-01-06 11:39:37 +09:00
background: var(--bg-pale-1);
border-top: 1px solid var(--divider);
}
@media screen and (max-width: 640px) {
border-radius: 0;
2020-08-04 12:13:41 +09:00
}
}
.xd-cards {
list-style: none;
display: flex;
flex-direction: row;
flex-wrap: nowrap;
justify-content: left;
> .xd-card {
width: 100%;
margin: 8px;
}
&.center {
justify-content: center;
}
@media screen and (max-width: 640px) {
flex-wrap: wrap;
> .xd-card {
margin: 8px 0;
}
2020-08-04 12:13:41 +09:00
}
&.wrap {
flex-wrap: wrap;
}
}
.mx-auto { margin-left: auto; margin-right: auto; }
.my-auto { margin-top: auto; margin-bottom: auto; }
.px-auto { padding-left: auto; padding-right: auto; }
.py-auto { padding-top: auto; padding-bottom: auto; }
@for $v from -5 through 5 {
$size: $v * 8px;
.ma-#{$v} { margin: $size; }
.ml-#{$v} { margin-left: $size; }
.mr-#{$v} { margin-right: $size; }
.mt-#{$v} { margin-top: $size; }
.mb-#{$v} { margin-bottom: $size; }
.mx-#{$v} { margin-left: $size; margin-right: $size; }
.my-#{$v} { margin-top: $size; margin-bottom: $size; }
.pa-#{$v} { padding: $size; }
.pl-#{$v} { padding-left: $size; }
.pr-#{$v} { padding-right: $size; }
.pt-#{$v} { padding-top: $size; }
.pb-#{$v} { padding-bottom: $size; }
.px-#{$v} { padding-left: $size; padding-right: $size; }
.py-#{$v} { padding-top: $size; padding-bottom: $size; }
}
.xd-slide-in {
animation: slideIn 1s ease-out;
}
@keyframes slideIn {
0% {
transform: translateY(32px);
opacity: 0;
}
100% {
transform: none;
opacity: 1;
}
}
figure {
margin: 0;
padding: 0;
}
@each $mode in none, block, inline, flex, grid, inline-block, inline-flex {
.display-#{$mode} { display: $mode; }
}
@media screen and (min-width: 901px) {
.hide-on-pc {
display: none !important;
}
}
@media screen and (max-width: 900px) and (min-width: 641px) {
.hide-on-tablet {
display: none !important;
}
}
@media screen and (max-width: 640px) {
.hide-on-mobile {
display: none !important;
}
}
@for $i from -18 through 18 {
.xd-tilt-#{$i * 5} {
display: inline-block;
transform: rotateZ($i * 5deg);
}
}
@keyframes blink {
0% { opacity: 1 }
10% { opacity: 1 }
12% { opacity: 0 }
14% { opacity: 1 }
20% { opacity: 1 }
21% { opacity: 0 }
39% { opacity: 0 }
40% { opacity: 1 }
48% { opacity: 1 }
49% { opacity: 0 }
50% { opacity: 1 }
54% { opacity: 1 }
55% { opacity: 0 }
56% { opacity: 1 }
85% { opacity: 1 }
89% { opacity: 0 }
95% { opacity: 1 }
}
.xd-big {
font-size: 2rem;
}
.xd-small {
font-size: 0.5rem;
}
.xd-blink {
animation: blink 2s infinite linear;
}
.xd-fluid {
width: 100%;
}
img, .xd-responsive {
max-width: 100%;
}
.xd-footer {
text-align: center;
// background: darken($bg, 2);
}
.xd-columns {
display: flex;
@media screen and (max-width: 640px) {
flex-wrap: wrap;
}
.xd-column {
&.gap-1 { margin: 8px; }
&.gap-2 { margin: 16px; }
&.gap-3 { margin: 24px; }
}
}
.xd-alert {
padding: 8px 16px;
2021-01-06 20:46:41 +09:00
display: flex;
align-items: center;
2021-01-06 11:39:37 +09:00
border-radius: var(--radius);
width: 100%;
2021-01-06 11:39:37 +09:00
background: var(--bg);
border: 1px solid var(--bg-pale-2);
color: var(--fg);
font-size: 75%;
2021-01-06 20:46:41 +09:00
> .icon {
opacity: 0.5;
font-size: 1.2rem;
margin-right: 16px;
}
&.danger {
2021-01-06 20:46:41 +09:00
> .icon {
opacity: 1;
}
2021-01-06 11:39:37 +09:00
background: var(--bg-danger);
border: 1px solid var(--divider-danger);
color: var(--fg-danger);
}
}
2020-08-04 12:13:41 +09:00
.xd-center {
text-align: center;
}
.xd-centerized {
display: flex;
justify-content: center;
align-items: center;
text-align: center;
width: 100vw;
height: 100vh;
}