Files
remanso/src/styles/app.css
Julien Calixte 9d1b6552cb feat(markdown): add hover download buttons on rendered SVGs
Attach SVG and PNG (×2) download buttons to every rendered SVG (TikZ,
Mermaid, …) once post-render finishes. Exports always use the original
colors with a white background baked in, regardless of theme.
2026-05-16 12:17:04 +02:00

352 lines
6.3 KiB
CSS

@charset "utf-8";
@import "tailwindcss";
@import url("https://fonts.googleapis.com/css2?display=swap&family=Courier+Prime&family=Libertinus+Serif");
:root {
--primary-color: #ffa4c0;
--font-family: "Libertinus Serif", serif;
--title-font-family: "Libertinus Serif", serif;
--font-size: 13pt;
--font-color: #4a4a4a;
--link: #445fb9;
--light-link: lighten(#445fb9, 45%);
--background-color: #ffffff;
--note-width: 500px;
--note-canvas-bg: color-mix(
in oklch,
var(--color-base-100) 60%,
var(--color-base-200)
);
--note-sheet-shadow: 1px 0 8px rgb(0 0 0 / 6%);
--color-contrast-content: var(--color-success);
--notyf-margin: 0.5rem;
}
[data-theme="light"] {
--color-contrast-content: var(--color-success-content);
}
@plugin "@tailwindcss/typography";
@plugin 'daisyui' {
themes:
light --default,
dracula --prefersdark;
}
@config '../../tailwind.config.js';
/**
The default border color has changed to `currentColor` in Tailwind CSS v4,
so we've added these compatibility styles to make sure everything still
looks the same as it did with Tailwind CSS v3.
If we ever want to remove these styles, we need to add an explicit border
color utility to any element that depends on these defaults.
*/
@layer base {
*,
::after,
::before,
::backdrop,
::file-selector-button {
border-color: var(--color-gray-200, currentColor);
}
}
html,
body {
height: 100dvh;
overflow: hidden;
scroll-behavior: smooth;
}
@media screen and (max-width: 768px) {
html,
body {
overflow-y: auto;
}
}
.columns {
margin-left: 0;
margin-right: 0;
margin-top: 0;
&:last-child {
margin-bottom: 0;
}
}
#app {
height: 100dvh;
display: flex;
}
a {
&.external-link {
text-decoration: underline;
&::after {
margin-left: 0.4rem;
content: url("/assets/external-link.svg");
}
}
}
.title-stacked-note {
color: var(--color-base-content);
text-decoration: none;
position: sticky;
top: 0;
overflow: visible;
display: flex;
gap: 0.5rem;
align-items: center;
}
a.title-stacked-note-link {
display: block;
overflow: visible;
&:hover {
cursor: pointer;
text-decoration: none;
}
}
.title-stacked-note ul,
.title-stacked-note li {
margin-top: 0;
margin-bottom: 0;
padding-left: 0;
text-decoration: none;
display: flex;
gap: 1rem;
}
.notyf__toast {
border-radius: revert-layer;
border: none;
}
@media only screen and (max-width: 500px) {
.notyf__toast {
margin: var(--notyf-margin);
width: calc(100% - 2 * var(--notyf-margin));
}
}
.alert-success .notyf__message {
color: var(--color-success-content);
}
.alert-error .notyf__message {
color: var(--color-error-content);
}
.alert {
max-width: 500px;
}
.repo-note,
.notyf {
font-family: var(--font-family);
font-size: var(--font-size);
}
.table,
.table :where(thead, tfoot) {
font-size: 1em;
}
.input:focus {
outline-style: none;
}
@media print {
html,
body {
overflow-y: auto;
height: auto;
}
#app {
height: auto;
}
}
pre {
code {
margin-right: 3rem;
}
}
pre.mermaid {
display: flex;
justify-content: center;
align-items: center;
background-color: var(--color-base-content);
}
pre.tikz {
display: block;
overflow-x: auto;
text-align: center;
padding: 0.5rem;
background: transparent;
}
pre.tikz svg {
max-width: 100%;
height: auto;
}
/* TikZ SVGs are monochrome black; invert them on dark themes so they
remain readable on the transparent background. */
[data-theme="dracula"] pre.tikz svg {
filter: invert(1) hue-rotate(180deg);
}
@media (prefers-color-scheme: dark) {
:root:not([data-theme="light"]) pre.tikz svg {
filter: invert(1) hue-rotate(180deg);
}
}
.tikz-loading {
opacity: 0.6;
font-style: italic;
}
.svg-download-host {
position: relative;
display: inline-block;
max-width: 100%;
}
.svg-download-buttons {
position: absolute;
top: 0.25rem;
right: 0.25rem;
display: flex;
gap: 0.25rem;
opacity: 0;
transition: opacity 150ms ease-in-out;
pointer-events: none;
z-index: 2;
}
.svg-download-host:hover .svg-download-buttons,
.svg-download-host:focus-within .svg-download-buttons {
opacity: 1;
pointer-events: auto;
}
.svg-download-button {
font-size: 0.7rem;
padding-inline: 0.4rem;
height: 1.5rem;
min-height: 1.5rem;
display: inline-flex;
align-items: center;
gap: 0.2rem;
}
.svg-download-button .icon-tabler-download {
width: 0.9rem;
height: 0.9rem;
max-width: none;
filter: none;
}
.tikz-error {
border-left: 3px solid var(--color-error);
padding: 0.5rem 0.75rem;
background: color-mix(in srgb, var(--color-error) 10%, transparent);
text-align: left;
}
.tikz-error pre {
white-space: pre-wrap;
font-size: 0.85em;
}
.markdown-alert {
padding: 1rem;
background-color: #ecf0f1;
border-radius: 1rem;
margin: 1rem 0;
color: var(--color-base-content);
background-color: var(--color-base-300);
}
.markdown-alert-important {
background-color: var(--color-primary);
color: var(--color-primary-content);
}
.markdown-alert-important .markdown-alert-title svg path {
fill: var(--color-primary-content);
}
.markdown-alert-tip {
background-color: var(--color-info);
color: var(--color-info-content);
}
.markdown-alert-tip .markdown-alert-title svg path {
fill: var(--color-info-content);
}
.markdown-alert-warning {
background-color: var(--color-warning);
color: var(--color-warning-content);
}
.markdown-alert-warning .markdown-alert-title svg path {
fill: var(--color-warning-content);
}
.markdown-alert-caution {
background-color: var(--color-error);
color: var(--color-error-content);
}
.markdown-alert-caution .markdown-alert-title svg path {
fill: var(--color-error-content);
}
.markdown-alert-title {
display: flex;
align-items: center;
gap: 0.5rem;
}
.markdown-alert-title svg path {
fill: var(--color-base-content);
}
iframe {
border-radius: 1rem;
height: 400px;
}
/* TODO page */
.todo-notes input[type="checkbox"] {
@apply checkbox checkbox-success;
}
.todo-notes li:has(> input[type="checkbox"]) {
list-style: none;
}
.tabs :where(pre):not(:where([class~="not-prose"], [class~="not-prose"] *)) {
margin-top: 0;
margin-bottom: 0;
padding-top: 0.2rem;
padding-inline-end: 0.2rem;
padding-bottom: 0.2rem;
padding-inline-start: 0.2rem;
}