Skip to content

Commit 66fe4de

Browse files
authored
[6.x] Themeable global header (#12214)
* wip * Support same button variants on Select/Combobox, override just the Global Site Selector style for theming * Support a dark global header color option too * yeet this css
1 parent 049d994 commit 66fe4de

12 files changed

Lines changed: 140 additions & 152 deletions

File tree

resources/css/components/global-header.css

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

resources/css/cp.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
@import './components/blueprints.css';
1717
@import './components/configure.css';
1818
@import './components/focal-point.css';
19-
@import './components/global-header.css';
2019
@import './components/index-fields.css';
2120
@import './components/notifications.css';
2221
@import './components/page-tree.css';

resources/css/ui.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
--color-content-border: var(--theme-color-content-border);
2626
--color-dark-content-bg: var(--theme-color-dark-content-bg);
2727
--color-dark-content-border: var(--theme-color-dark-content-border);
28-
--color-global-header-bg: var(--theme-color-gray-800);
28+
--color-global-header-bg: var(--theme-color-global-header-bg);
29+
--color-dark-global-header-bg: var(--theme-color-dark-global-header-bg);
2930
--color-progress-bar: var(--theme-color-progress-bar);
3031
--color-ui-accent: var(--theme-color-ui-accent);
3132
--color-dark-ui-accent: var(--theme-color-dark-ui-accent);

resources/js/components/GlobalSiteSelector.vue

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,15 @@
11
<template>
2-
<div class="site-selector flex h-full items-center dark:border-dark-900">
2+
<div class="flex h-full items-center" data-ui-global-site-selector>
33
<Select
4+
:model-value="active"
45
:options="sites"
5-
option-label="name"
6-
option-value="handle"
76
:searchable="false"
8-
:model-value="active"
9-
:button-appearance="false"
107
@update:model-value="selected"
11-
>
12-
<template #selected-option="{ option }">
13-
<div class="flex items-center gap-2 text-sm font-medium text-[0.8125rem] text-gray-300 hover:text-white">
14-
<ui-icon name="globe-arrow" class="size-4" />
15-
<div class="whitespace-nowrap">{{ __(option.name) }}</div>
16-
</div>
17-
</template>
18-
<template #option="option">
19-
<div class="whitespace-nowrap" :class="{ 'text-gray-500': handle === active }">{{ __(option.name) }}</div>
20-
</template>
21-
</Select>
8+
option-label="name"
9+
option-value="handle"
10+
size="sm"
11+
icon="globe-arrow"
12+
/>
2213
</div>
2314
</template>
2415

@@ -51,3 +42,10 @@ export default {
5142
},
5243
};
5344
</script>
45+
46+
<style>
47+
[data-ui-global-site-selector] [data-ui-combobox-trigger] {
48+
background: rgba(0,0,0,.5) !important;
49+
border: transparent !important;
50+
}
51+
</style>

resources/js/components/command-palette/CommandPalette.vue

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -238,10 +238,16 @@ const modalClasses = cva({
238238
<template>
239239
<DialogRoot v-model:open="open" :modal="true">
240240
<DialogTrigger>
241-
<div class="data-[focus-visible]:outline-focus hover flex cursor-text items-center gap-x-2 rounded-md [button:has(>&)]:rounded-md bg-gray-900 text-xs text-gray-400 shadow-[0_-1px_rgba(255,255,255,0.06),0_4px_8px_rgba(0,0,0,0.05),0_1px_6px_-4px_#000] ring-1 ring-gray-900/10 outline-none hover:ring-white/10 md:w-32 md:py-[calc(5/16*1rem)] md:ps-2 md:pe-1.5 md:shadow-[0_1px_5px_-4px_rgba(19,19,22,0.4),0_2px_5px_rgba(32,42,54,0.06)]">
242-
<Icon name="magnifying-glass" class="size-5 flex-none text-gray-600" />
241+
<div class="
242+
data-[focus-visible]:outline-focus hover flex cursor-text items-center gap-x-1.5 group h-8
243+
rounded-lg [button:has(>&)]:rounded-md bg-black/40 text-xs text-white/60 outline-none
244+
border-b border-b-white/20 inset-shadow-sm inset-shadow-black/20
245+
md:w-32 md:py-[calc(5/16*1rem)] md:px-2
246+
hover:bg-black/45 hover:text-white/70
247+
">
248+
<Icon name="magnifying-glass" class="size-5 flex-none text-white/50 group-hover:text-white/70" />
243249
<span class="sr-only leading-none md:not-sr-only st-text-trim-cap">Search</span>
244-
<kbd class="ml-auto hidden self-center rounded bg-white/5 px-[0.3125rem] py-[0.0625rem] text-[0.625rem]/4 font-medium text-gray-400 ring-1 ring-white/7.5 [word-spacing:-0.15em] ring-inset md:block">
250+
<kbd class="ml-auto hidden self-center rounded bg-white/5 px-[0.3125rem] py-[0.0625rem] text-[0.625rem]/4 font-medium text-white/60 group-hover:text-white/70 ring-1 ring-white/7.5 [word-spacing:-0.15em] ring-inset md:block">
245251
<kbd class="font-sans">⌘ </kbd><kbd class="font-sans">K</kbd>
246252
</kbd>
247253
</div>

resources/js/components/ui/Button/Button.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const iconOnly = computed(() => (props.icon && !hasDefaultSlot && !props.text) |
2626
2727
const buttonClasses = computed(() => {
2828
const classes = cva({
29-
base: 'inline-flex items-center justify-center whitespace-nowrap shrink-0 font-medium antialiased cursor-pointer no-underline disabled:text-gray-400 dark:disabled:text-gray-600 disabled:cursor-not-allowed [&_svg]:shrink-0 [&_svg]:text-gray-600 dark:[&_svg]:text-gray-500',
29+
base: 'inline-flex items-center justify-center whitespace-nowrap shrink-0 font-medium antialiased cursor-pointer no-underline disabled:text-gray-400 dark:disabled:text-gray-600 disabled:cursor-not-allowed [&_svg]:shrink-0 [&_svg]:text-black [&_svg]:opacity-60 dark:[&_svg]:text-white',
3030
variants: {
3131
variant: {
3232
default: [
@@ -37,9 +37,9 @@ const buttonClasses = computed(() => {
3737
'bg-linear-to-b from-primary/90 to-primary hover:bg-primary-hover text-white border border-primary-border shadow-ui-md inset-shadow-2xs inset-shadow-white/25 [&_svg]:text-white [&_svg]:opacity-60',
3838
],
3939
danger: 'bg-linear-to-b from-red-600/90 to-red-600 hover:bg-red-600/90 text-white border border-red-600 inset-shadow-2xs inset-shadow-red-300 [&_svg]:text-red-200 disabled:text-red-200',
40-
filled: 'bg-gray-100 hover:bg-gray-200 hover:text-gray-900 dark:hover:text-white dark:bg-gray-700/80 dark:hover:bg-gray-700 [&_svg]:text-gray-700 dark:[&_svg]:text-gray-300',
41-
ghost: 'bg-transparent hover:bg-gray-400/10 text-gray-900 dark:text-gray-300 dark:hover:bg-gray-800/50 dark:hover:text-gray-200',
42-
subtle: 'bg-transparent hover:bg-gray-400/10 text-gray-500 hover:text-gray-700 dark:text-gray-300 dark:hover:bg-gray-700/80 dark:hover:text-gray-200 [&_svg]:text-gray-400',
40+
filled: 'bg-black/5 hover:bg-black/10 hover:text-gray-900 dark:hover:text-white dark:bg-white/15 dark:hover:bg-white/20 [&_svg]:opacity-70',
41+
ghost: 'bg-transparent hover:bg-gray-400/10 text-gray-900 dark:text-gray-300 dark:hover:bg-white/15 dark:hover:text-gray-200',
42+
subtle: 'bg-transparent hover:bg-gray-400/10 text-gray-500 hover:text-gray-700 dark:text-gray-300 dark:hover:bg-white/15 dark:hover:text-gray-200 [&_svg]:opacity-40',
4343
},
4444
size: {
4545
lg: 'px-6 h-12 text-base gap-2 rounded-lg text-base',

0 commit comments

Comments
 (0)