Skip to content

Commit a6c00ba

Browse files
Merge pull request #39 from directus/connor/dark-mode-type-fixes
So Many Things
2 parents fc7488d + ddc9793 commit a6c00ba

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+7901
-3809
lines changed

.github/workflows/lint-app.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ concurrency:
1414

1515
env:
1616
NODE_OPTIONS: --max_old_space_size=6144
17+
NUXT_PUBLIC_PRODUCT_DIRECTUS_URL: https://product-team.directus.app
1718

1819
jobs:
1920
app-lint:

.github/workflows/lint-oas.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ concurrency:
1414

1515
env:
1616
NODE_OPTIONS: --max_old_space_size=6144
17+
NUXT_PUBLIC_PRODUCT_DIRECTUS_URL: https://product-team.directus.app
1718

1819
jobs:
1920
oas-lint:

.github/workflows/typecheck.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ concurrency:
1414

1515
env:
1616
NODE_OPTIONS: --max_old_space_size=6144
17+
NUXT_PUBLIC_PRODUCT_DIRECTUS_URL: https://product-team.directus.app
1718

1819
jobs:
1920
typecheck:
@@ -28,3 +29,4 @@ jobs:
2829

2930
- name: Run Typechecker
3031
run: pnpm typecheck
32+

app/assets/css/_vars.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
--area--community: var(--red);
3636
}
3737

38-
.dark-mode {
38+
.dark {
3939
--typography: var(--white);
4040
--typography-subdued: color-mix(in hsl shorter hue, var(--white) 70%, var(--black) 30%);
4141

app/assets/css/main.scss

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,21 @@ body {
66
background-color: var(--background);
77
font-family: var(--font--body);
88
color: var(--typography);
9+
max-width: 100vw;
10+
}
11+
12+
.light {
13+
color-scheme: light;
14+
}
15+
16+
.dark {
17+
color-scheme: dark;
18+
}
19+
20+
html {
21+
overflow: overlay;
22+
scrollbar-color: var(--border-subtle) var(--background-subdued);
23+
scrollbar-width: thin;
924
}
1025

1126
a {
@@ -34,6 +49,9 @@ pre {
3449
padding: 0 24px;
3550
margin-left: auto;
3651
margin-right: auto;
52+
@media (max-width: 768px) {
53+
padding: 0 12px;
54+
}
3755
}
3856

3957
.container .container {
@@ -62,7 +80,7 @@ pre {
6280
font-size: 1.1rem;
6381
}
6482
}
65-
p, img, ul, ol, table, .TabsRoot {
83+
p, img, ul, ol, .prose-table-wrapper, .TabsRoot {
6684
margin-bottom: 1rem;
6785
}
6886
.box, .directus-cloud, .callout, .prose-pre {
@@ -132,3 +150,8 @@ pre {
132150
font-size: 14px;
133151
font-weight: 500;
134152
}
153+
154+
hr {
155+
border: 0;
156+
border-top: 2px solid var(--border);
157+
}

app/assets/img/pink-cta-bg.svg

Lines changed: 687 additions & 0 deletions
Loading

app/assets/img/purple-cta-bg.svg

Lines changed: 687 additions & 0 deletions
Loading

app/components/Button.vue

Lines changed: 54 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@
33
const props = withDefaults(
44
defineProps<{
55
type?: 'a' | 'button' | 'submit' | 'reset' | 'span';
6-
label: string;
6+
label?: string;
77
color?: 'primary' | 'white' | 'outline-only';
88
size?: 'small' | 'medium';
99
href?: string;
1010
target?: '_blank' | '_self' | '_parent' | '_top';
11+
disabled?: boolean;
12+
loading?: boolean;
1113
}>(),
1214
{
1315
type: 'button',
@@ -21,31 +23,70 @@ const buttonProps = computed(() => {
2123
return {
2224
href: props.href,
2325
target: props.target,
26+
disabled: props.disabled || props.loading,
2427
};
2528
}
2629
27-
return {};
30+
return {
31+
disabled: props.disabled || props.loading,
32+
};
2833
});
2934
</script>
3035

3136
<template>
3237
<component
3338
:is="type"
3439
v-bind="buttonProps"
35-
:class="['button', `size-${size}`, `color-${color}`]"
40+
:class="['button', `size-${size}`, `color-${color}`, { loading: loading }]"
3641
>
37-
{{ label }}
42+
<template v-if="!loading">
43+
{{ label }}
44+
</template>
45+
<slot v-if="!loading" />
46+
<div v-else>
47+
<p class="loading-text">
48+
Loading
49+
</p>
50+
<div class="loading-icon">
51+
<Icon name="svg-spinners:180-ring-with-bg" />
52+
</div>
53+
</div>
3854
</component>
3955
</template>
4056

4157
<style scoped lang="scss">
58+
.loading-text {
59+
opacity: 0;
60+
}
61+
62+
.loading-icon {
63+
position: absolute;
64+
top: 0;
65+
left: 0;
66+
right: 0;
67+
bottom: 0;
68+
display: flex;
69+
align-items: center;
70+
justify-content: center;
71+
}
72+
4273
.button {
43-
display: inline-block;
74+
position: relative;
75+
display: inline-flex;
76+
align-items: center;
77+
justify-content: center;
4478
text-decoration: none;
4579
border-radius: var(--border-radius);
4680
border: 1px solid transparent;
4781
font-weight: 500;
82+
cursor: pointer;
83+
84+
&:disabled {
85+
cursor: not-allowed;
86+
opacity: 0.75;
87+
}
4888
}
89+
4990
.size-small {
5091
font-size: 14px;
5192
padding: 0.2rem 0.6rem;
@@ -55,17 +96,19 @@ const buttonProps = computed(() => {
5596
padding: 0.25rem 0.75rem;
5697
}
5798
.color-primary {
58-
background: var(--primary);
5999
color: white;
100+
background: var(--primary);
60101
border-color: var(--primary);
61-
&:hover {
102+
103+
&:not(:disabled):hover {
62104
border-color: var(--primary-5);
63105
background: var(--primary-5);
64106
}
65107
}
108+
66109
.dark-mode .color-primary {
67110
border-color: var(--primary-3);
68-
&:hover {
111+
&:not(:disabled):hover {
69112
border-color: var(--primary-4);
70113
background: var(--primary-4);
71114
}
@@ -75,14 +118,15 @@ const buttonProps = computed(() => {
75118
background: var(--background-subdued);
76119
color: var(--typography);
77120
border-color: var(--border);
78-
&:hover {
121+
&:not(:disabled):hover {
79122
border-color: var(--border-subdued);
80123
background: var(--background-subtle);
81124
}
82125
}
83126
.color-outline-only {
84127
border-color: var(--border-subdued);
85-
&:hover {
128+
background: var(--background);
129+
&:not(:disabled):hover {
86130
border-color: var(--border-subtle);
87131
background: var(--background-subdued);
88132
}

app/components/DefaultLayout.vue

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<script setup lang="ts">
2+
const route = useRoute();
3+
</script>
4+
5+
<template>
6+
<div>
7+
<HeaderBanner />
8+
<HeaderHero v-if="route.path === '/' || route.path === '/getting-started/overview'" />
9+
<HeaderHat v-else>
10+
<slot name="mobile-nav" />
11+
</HeaderHat>
12+
<HeaderNav />
13+
<slot />
14+
</div>
15+
</template>

app/components/NavSectionList.vue

Lines changed: 0 additions & 55 deletions
This file was deleted.

0 commit comments

Comments
 (0)