~james/core

core/blog/src/styles/global.css -rw-r--r-- 2.8 KiB
452f17b7 — james chore(import): snapshot james.dad.town/core at f70c71c7696a 16 hours ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
@import "tailwindcss";

/* font files land in public/fonts from nix/pkgs/web-static-files.nix */
@import "../../../web/src/theme.css";
@import "../../../web/src/fonts.css";
@import "../../../web/src/markup.css";

@source "../../../web/src/lib/components/ui";
@source "../../posts";

html {
    color-scheme: light;
    @variant dark {
        color-scheme: dark;
    }
}

@theme {
    /* the docs site's --sl-content-width */
    --container-column: 36rem;
}

@layer base {
    html {
        font-size: 16px;
    }

    body {
        @apply flex min-h-screen flex-col bg-background-canvas typography-paragraph-body text-foreground-default;
        text-wrap-style: pretty;
    }

    a {
        @apply text-foreground-default no-underline decoration-foreground-default decoration-from-font underline-offset-4;
    }

    ::selection {
        background-color: var(--color-background-info-subtle-hover);
        color: var(--color-foreground-default);
    }
}

@layer components {
    .panel {
        @apply rounded-md border border-border-default bg-background-default;
    }

    /* superlogical's masthead: title and subtitle read as one block, the
	   subtitle only greyed */
    .title,
    .lede {
        @apply typography-heading-2;
    }

    .lede {
        @apply text-foreground-placeholder;
    }

    .meta {
        @apply typography-paragraph-regular text-foreground-muted;
    }

    .post {
        @apply text-xl leading-2xl text-foreground-muted;

        a {
            @apply decoration-[0.1rem] hover:decoration-foreground-link-hover;
        }
    }

    .post :is(p, blockquote, ul, ol, pre, table, details) {
        @apply my-lg;
    }

    /* markup.css rules h1 and h2 off like a readme; a post's headings stand alone */
    .post :is(h1, h2, h3, h4, h5, h6) {
        @apply mt-3xl mb-md border-b-0 pb-0;
    }

    .post :is(h1, h2, h3, h4, h5, h6) + * {
        @apply mt-none;
    }

    .post h2 {
        @apply typography-heading-4;
    }

    /* markup.css's h3 and h4 would otherwise sit at or below the body size */
    .post :is(h3, h4, h5, h6) {
        @apply typography-paragraph-large;
    }

    .post pre {
        @apply rounded-md;
    }

    .post > :first-child {
        @apply mt-none;
    }

    .post :is(p, li, dd, blockquote) {
        @apply wrap-break-word;
    }

    .post a {
        @apply text-foreground-default;
    }

    .post figure {
        @apply my-xl;
    }

    .post figcaption {
        @apply mt-xs typography-paragraph-regular text-foreground-subtle;
    }

    .post :is(img, video) {
        @apply rounded-md border border-border-default;
    }

    /* shiki emits both palettes as variables (defaultColor: false) */
    .post pre.astro-code,
    .post pre.astro-code span {
        color: var(--shiki-light);

        @variant dark {
            color: var(--shiki-dark);
        }
    }
}