1
Fork 0
mirror of https://github.com/RGBCube/Site synced 2025-08-02 05:57:46 +00:00
Site/site/assets/css/default.css
2025-07-11 23:46:22 +03:00

367 lines
6.7 KiB
CSS

@import "tailwindcss";
@theme {
--font-sans: "Exo 2";
--font-serif: "Exo 2";
--font-mono: "Ubuntu Mono";
@keyframes blink {
0%, 100% {
opacity: 100%;
}
50% {
opacity: 0%;
}
}
--animate-blink: blink 0.2s steps(1) infinite;
@keyframes blink-red-white {
0%, 100% {
background-color: red;
}
50% {
background-color: white;
}
}
--animate-blink-red-white: blink-red-white 0.2s steps(1) infinite;
@keyframes to-the-future {
0% {
transform: skewX(0deg);
}
100% {
transform: skewX(-89.9deg);
}
}
--animate-to-the-future: to-the-future 50ms cubic-bezier(
0.16,
0.56,
0.44,
0.93
) 1;
@keyframes shake-x {
0%, 100% {}
50% {
transform: translateX(4px);
}
}
--animate-shake-x: shake-x 0.07s linear infinite;
@keyframes shake-y {
0%, 100% {}
50% {
transform: translateY(4px);
}
}
--animate-shake-y: shake-y 0.08s linear infinite;
@keyframes shake-sm-x {
0%, 100% {}
50% {
transform: translateX(2px);
}
}
--animate-shake-sm-x: shake-sm-x 0.07s linear infinite;
@keyframes shake-sm-y {
0%, 100% {}
50% {
transform: translateY(2px);
}
}
--animate-shake-sm-y: shake-sm-y 0.08s linear infinite;
@keyframes slide-down-shake-sm {
0% {
transform: translateY(-100%);
}
70% {
transform: translateY(0);
}
75% {
transform: translateY(0) translateX(2px);
}
80% {
transform: translateY(0) translateX(-2px);
}
85% {
transform: translateY(0) translateX(1px);
}
90% {
transform: translateY(0) translateX(-1px);
}
95% {
transform: translateY(0) translateX(0.5px);
}
100% {
transform: translateY(0) translateX(0);
}
}
--animate-slide-down-shake: slide-down-shake 0.8s linear forwards;
}
.shake {
@apply animate-shake-x;
& > * {
@apply animate-shake-y;
}
}
.shake-sm {
@apply animate-shake-sm-x;
& > * {
@apply animate-shake-sm-y;
}
}
.nuclear {
&:active {
@apply animate-blink-red-white text-white;
-webkit-text-stroke: 0.05rem black;
}
&:hover {
@apply text-white;
-webkit-text-stroke: 0.05rem black;
&:not(:active) {
background: repeating-linear-gradient(
45deg,
yellow 0rem,
yellow 0.625rem,
black 0.625rem,
black 1.25rem
);
}
}
}
body {
height: 100dvh;
width: 100dvw;
}
.text-content {
@apply space-y-3;
* {
@apply wrap-break-word text-pretty;
&:not(ul) {
@apply space-y-3;
}
}
h1, h2, h3, h4, h5, h6 {
@apply text-balance before:pr-2 font-bold;
}
h1 {
@apply text-4xl before:content-["#"];
}
h2 {
@apply text-3xl before:content-["##"];
}
h3 {
@apply text-2xl before:content-["###"];
}
h4 {
@apply text-xl before:content-["####"];
}
p {
&:has(img) {
@apply flex justify-center;
}
}
a:not(.reset) {
@apply m-0;
* {
@apply wrap-anywhere;
}
/* See next FIXME */
&:not(/* :has(> code:only-child), */ :has(> img)) {
@apply px-1;
&:not(.font-mono) {
@apply pb-0.75;
}
}
&:not(:has(h1, h2, h3, h4, h5, h6)) {
@apply inline wrap-anywhere text-[red] dark:text-[yellow] border-2
border-[transparent] border-dashed;
/* FIXME: :only-child still triggers when there is sibling raw content: <a>foo bar: <code>this is an only child</code></a> */
/* &:has(> code:only-child) { */
/* @apply border-dotted; */
/* } */
&:hover {
@apply border-[red] dark:border-[yellow];
}
&:active {
@apply border-[fuchsia] dark:border-[springgreen] animate-to-the-future;
}
}
& :where(h1, h2, h3, h4, h5, h6) {
@apply before:underline before:underline-offset-4;
* {
@apply inline-block;
}
&:hover::before {
@apply italic text-[red] dark:text-[yellow];
}
}
}
/* TODO: Make it better. */
table {
@apply border-collapse whitespace-nowrap;
}
th, td {
@apply p-1 border-2;
}
th {
@apply bg-black text-white border-black dark:bg-white dark:text-black
dark:border-white;
}
td {
@apply border-black dark:border-white;
}
code:not(pre > code) {
@apply border-1 border-dotted px-2 py-0.5 border-black dark:border-white;
/* See previous FIXME */
/* a:is(:hover, :active) */
/* &:not(:where(h1, h2, h3, h4, h5, h6) code):only-child { */
/* @apply border-transparent; */
/* } */
}
pre code, pre code * {
@apply whitespace-pre;
}
div:has(> pre code) {
@apply outline outline-dotted outline-offset-1 outline-[#444] border-1
border-black p-2 bg-[#eee] dark:outline-[#bbb] dark:border-white
dark:bg-[#111];
}
ol {
& li {
counter-increment: item;
> * {
@apply inline;
}
}
& li::before {
content: counter(item) ". ";
}
}
li:not(.reset) {
@apply relative pl-4;
ul &::before {
@apply content-[""] absolute left-0 size-2 top-1/2 -translate-y-1/3
rotate-45 border-t-2 border-r-2 border-black dark:border-white;
}
ul &:hover {
&::before {
@apply size-4 -translate-x-2/3 border-[red] dark:border-[yellow];
}
}
}
hr {
@apply border-1 border-black dark:border-white;
}
blockquote {
@apply border-1 border-black dark:border-white p-2 bg-[#eee]
shadow-[4px_4px_#444] dark:bg-[#111] dark:shadow-[4px_4px_#bbb];
}
details {
& > summary {
@apply inline-block border-4 border-double border-[red]
hover:border-[maroon] dark:border-[yellow] dark:hover:border-[goldenrod]
p-4 cursor-pointer;
}
}
.callout {
@apply px-2.5 py-1 select-none text-white bg-black dark:text-black
dark:bg-white;
}
.token-addition {
@apply text-[green] dark:text-[mediumspringgreen];
}
.token-deletion {
@apply text-[maroon] dark:text-[crimson];
}
.token-attr {
@apply text-[darkblue] dark:text-[lightblue];
}
.token-built_in {
@apply text-[darkred] dark:text-[firebrick];
}
.token-comment {
@apply italic text-[dimgray] dark:text-[darkgray];
}
.token-keyword {
@apply text-[darkred] dark:text-[firebrick];
}
.token-meta {
@apply text-[darkmagenta] dark:text-[orchid];
}
.token-number {
@apply text-[darkslateblue] dark:text-[mediumslateblue];
}
.token-string {
@apply text-[darkgreen] dark:text-[limegreen];
}
.token-symbol {
@apply text-[darkgoldenrod] dark:text-[gold];
}
.token-title {
@apply text-[indianred] dark:text-[lightcoral];
}
.token-type {
@apply text-[darkcyan] dark:text-[aquamarine];
}
}