@histoire/app 0.11.4 → 0.11.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app/style/{floating-vue.pcss → floating.pcss} +0 -0
- package/dist/app/style/main.pcss +46 -44
- package/dist/app/style/sandbox.css +1 -1
- package/dist/bundle-main-dev.js +4 -0
- package/dist/bundle-sandbox-dev.js +2 -0
- package/dist/bundled/App.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/bundled/components/HomeView.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/bundled/components/app/AppHeader.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/bundled/components/app/AppLogo.vue_vue_type_script_setup_true_lang.js +1 -0
- package/dist/bundled/components/app/Breadcrumb.js +2 -2
- package/dist/bundled/components/app/Breadcrumb.vue_vue_type_script_setup_true_lang.js +10 -9
- package/dist/bundled/components/app/Breadcrumb.vue_vue_type_style_index_0_scoped_36846ccf_lang.js +4 -0
- package/dist/bundled/components/app/InitialLoading.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/bundled/components/app/MobileOverlay.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/bundled/components/base/BaseCheckbox.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/bundled/components/base/BaseEmpty.js +4 -4
- package/dist/bundled/components/base/BaseEmpty.vue_vue_type_style_index_0_scoped_c5ecfead_lang.js +4 -0
- package/dist/bundled/components/base/BaseListItemLink.js +1 -1
- package/dist/bundled/components/base/BaseOverflowMenu.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/bundled/components/base/BaseOverflowTab.js +1 -1
- package/dist/bundled/components/base/BaseSelect.vue_vue_type_script_setup_true_lang.js +4 -1
- package/dist/bundled/components/base/BaseSplitPane.js +2 -2
- package/dist/bundled/components/base/BaseSplitPane.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/bundled/components/base/BaseSplitPane.vue_vue_type_style_index_0_scoped_ed925107_lang.js +4 -0
- package/dist/bundled/components/base/BaseTab.js +1 -1
- package/dist/bundled/components/base/BaseTag.js +13 -0
- package/dist/bundled/components/panel/ControlsComponentPropItem.vue_vue_type_script_setup_true_lang.js +1 -0
- package/dist/bundled/components/panel/ControlsComponentProps.vue_vue_type_script_setup_true_lang.js +8 -7
- package/dist/bundled/components/panel/PaneTabs.vue_vue_type_script_setup_true_lang.js +15 -12
- package/dist/bundled/components/panel/StatePresets.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/bundled/components/panel/StoryControls.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/bundled/components/panel/StoryDocs.vue_vue_type_script_setup_true_lang.js +17 -2
- package/dist/bundled/components/panel/StoryEvent.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/bundled/components/panel/StoryEvents.vue_vue_type_script_setup_true_lang.js +2 -1
- package/dist/bundled/components/panel/StorySidePanel.vue_vue_type_script_setup_true_lang.js +9 -3
- package/dist/bundled/components/panel/StorySourceCode.js +2 -2
- package/dist/bundled/components/panel/StorySourceCode.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/bundled/components/panel/StorySourceCode.vue_vue_type_style_index_0_scoped_36810e45_lang.js +4 -0
- package/dist/bundled/components/search/SearchItem.js +2 -2
- package/dist/bundled/components/search/SearchItem.vue_vue_type_script_setup_true_lang.js +3 -2
- package/dist/bundled/components/search/SearchItem.vue_vue_type_style_index_0_scoped_d95fcb03_lang.js +4 -0
- package/dist/bundled/components/search/SearchLoading.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/bundled/components/search/SearchModal.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/bundled/components/search/SearchPane.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/bundled/components/story/GenericMountStory.vue_vue_type_script_setup_true_lang.js +1 -0
- package/dist/bundled/components/story/GenericRenderStory.vue_vue_type_script_setup_true_lang.js +1 -0
- package/dist/bundled/components/story/StoryResponsivePreview.js +2 -2
- package/dist/bundled/components/story/StoryResponsivePreview.vue_vue_type_script_setup_true_lang.js +41 -12
- package/dist/bundled/components/story/StoryResponsivePreview.vue_vue_type_style_index_0_scoped_a83b1911_lang.js +4 -0
- package/dist/bundled/components/story/StoryVariantGrid.vue_vue_type_script_setup_true_lang.js +4 -1
- package/dist/bundled/components/story/StoryVariantGridItem.js +2 -2
- package/dist/bundled/components/story/StoryVariantGridItem.vue_vue_type_script_setup_true_lang.js +21 -9
- package/dist/bundled/components/story/StoryVariantGridItem.vue_vue_type_style_index_0_scoped_f7c98176_lang.js +4 -0
- package/dist/bundled/components/story/StoryVariantListItem.js +2 -2
- package/dist/bundled/components/story/StoryVariantListItem.vue_vue_type_script_setup_true_lang.js +3 -2
- package/dist/bundled/components/story/StoryVariantListItem.vue_vue_type_style_index_0_scoped_ab890d9c_lang.js +4 -0
- package/dist/bundled/components/story/StoryVariantSingle.js +2 -2
- package/dist/bundled/components/story/StoryVariantSingle.vue_vue_type_script_setup_true_lang.js +3 -3
- package/dist/bundled/components/story/StoryVariantSingle.vue_vue_type_style_index_0_scoped_ddfc5b4f_lang.js +4 -0
- package/dist/bundled/components/story/StoryVariantSinglePreviewNative.vue_vue_type_script_setup_true_lang.js +19 -7
- package/dist/bundled/components/story/StoryVariantSinglePreviewRemote.vue_vue_type_script_setup_true_lang.js +4 -1
- package/dist/bundled/components/story/StoryVariantSingleView.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/bundled/components/story/StoryView.vue_vue_type_script_setup_true_lang.js +5 -2
- package/dist/bundled/components/story/StoryViewer.js +2 -2
- package/dist/bundled/components/story/StoryViewer.vue_vue_type_script_setup_true_lang.js +3 -3
- package/dist/bundled/components/story/StoryViewer.vue_vue_type_style_index_0_scoped_6046525f_lang.js +4 -0
- package/dist/bundled/components/toolbar/ToolbarBackground.js +2 -2
- package/dist/bundled/components/toolbar/ToolbarBackground.vue_vue_type_script_setup_true_lang.js +32 -18
- package/dist/bundled/components/toolbar/ToolbarBackground.vue_vue_type_style_index_0_scoped_c48fb2b2_lang.js +4 -0
- package/dist/bundled/components/toolbar/ToolbarNewTab.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/bundled/components/toolbar/ToolbarResponsiveSize.vue_vue_type_script_setup_true_lang.js +3 -3
- package/dist/bundled/components/toolbar/ToolbarTextDirection.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/bundled/components/toolbar/ToolbarTitle.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/bundled/components/tree/StoryGroup.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/bundled/components/tree/StoryList.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/bundled/components/tree/StoryListFolder.js +2 -2
- package/dist/bundled/components/tree/StoryListFolder.vue_vue_type_script_setup_true_lang.js +6 -3
- package/dist/bundled/components/tree/StoryListFolder.vue_vue_type_style_index_0_scoped_2fedbe45_lang.js +4 -0
- package/dist/bundled/components/tree/StoryListItem.js +2 -2
- package/dist/bundled/components/tree/StoryListItem.vue_vue_type_script_setup_true_lang.js +5 -4
- package/dist/bundled/components/tree/StoryListItem.vue_vue_type_style_index_0_scoped_19810958_lang.js +4 -0
- package/dist/bundled/style.css +48 -47
- package/dist/bundled/util/preview-settings.js +11 -0
- package/dist/style.css +55 -55
- package/package.json +4 -4
- package/src/app/App.vue +1 -1
- package/src/app/components/HomeView.vue +1 -1
- package/src/app/components/app/AppHeader.vue +1 -1
- package/src/app/components/app/AppLogo.vue +1 -0
- package/src/app/components/app/Breadcrumb.vue +1 -1
- package/src/app/components/app/InitialLoading.vue +1 -1
- package/src/app/components/app/MobileOverlay.vue +1 -1
- package/src/app/components/base/BaseCheckbox.vue +1 -1
- package/src/app/components/base/BaseCopyIcon.vue +1 -1
- package/src/app/components/base/BaseEmpty.vue +1 -1
- package/src/app/components/base/BaseListItemLink.vue +1 -0
- package/src/app/components/base/BaseOverflowMenu.vue +1 -1
- package/src/app/components/base/BaseOverflowTab.vue +1 -0
- package/src/app/components/base/BaseSelect.vue +1 -0
- package/src/app/components/base/BaseSplitPane.vue +1 -1
- package/src/app/components/base/BaseTab.vue +1 -0
- package/src/app/components/base/BaseTag.vue +5 -0
- package/src/app/components/panel/ControlsComponentPropItem.vue +1 -0
- package/src/app/components/panel/ControlsComponentProps.vue +1 -1
- package/src/app/components/panel/PaneTabs.vue +7 -12
- package/src/app/components/panel/StatePresets.vue +1 -1
- package/src/app/components/panel/StoryControls.vue +1 -1
- package/src/app/components/panel/StoryDocs.vue +30 -1
- package/src/app/components/panel/StoryEvent.vue +1 -1
- package/src/app/components/panel/StoryEvents.vue +4 -1
- package/src/app/components/panel/StorySidePanel.vue +9 -3
- package/src/app/components/panel/StorySourceCode.vue +1 -1
- package/src/app/components/search/SearchItem.vue +1 -0
- package/src/app/components/search/SearchLoading.vue +1 -1
- package/src/app/components/search/SearchModal.vue +1 -1
- package/src/app/components/search/SearchPane.vue +1 -1
- package/src/app/components/story/GenericMountStory.vue +1 -0
- package/src/app/components/story/GenericRenderStory.vue +1 -0
- package/src/app/components/story/StoryResponsivePreview.vue +11 -2
- package/src/app/components/story/StoryVariantGrid.vue +5 -1
- package/src/app/components/story/StoryVariantGridItem.vue +18 -4
- package/src/app/components/story/StoryVariantListItem.vue +1 -0
- package/src/app/components/story/StoryVariantSingle.vue +1 -1
- package/src/app/components/story/StoryVariantSinglePreviewNative.vue +17 -5
- package/src/app/components/story/StoryVariantSinglePreviewRemote.vue +1 -0
- package/src/app/components/story/StoryVariantSingleView.vue +1 -1
- package/src/app/components/story/StoryView.vue +5 -2
- package/src/app/components/story/StoryViewer.vue +1 -1
- package/src/app/components/toolbar/ToolbarBackground.vue +21 -7
- package/src/app/components/toolbar/ToolbarNewTab.vue +1 -1
- package/src/app/components/toolbar/ToolbarResponsiveSize.vue +3 -3
- package/src/app/components/toolbar/ToolbarTextDirection.vue +1 -1
- package/src/app/components/toolbar/ToolbarTitle.vue +1 -1
- package/src/app/components/tree/StoryGroup.vue +1 -1
- package/src/app/components/tree/StoryList.vue +1 -1
- package/src/app/components/tree/StoryListFolder.vue +4 -1
- package/src/app/components/tree/StoryListItem.vue +1 -0
- package/src/app/style/{floating-vue.pcss → floating.pcss} +0 -0
- package/src/app/style/main.pcss +46 -44
- package/src/app/style/sandbox.css +1 -1
- package/src/app/util/preview-settings.ts +13 -0
- package/src/bundle-main-dev.js +4 -0
- package/src/bundle-sandbox-dev.js +2 -0
- package/tailwind.config.cjs +1 -1
- package/dist/bundled/components/app/Breadcrumb.vue_vue_type_style_index_0_scoped_3c779b73_lang.js +0 -4
- package/dist/bundled/components/base/BaseEmpty.vue_vue_type_style_index_0_scoped_af3328a6_lang.js +0 -4
- package/dist/bundled/components/base/BaseSplitPane.vue_vue_type_style_index_0_scoped_bb6c600c_lang.js +0 -4
- package/dist/bundled/components/panel/StorySourceCode.vue_vue_type_style_index_0_scoped_0d096b10_lang.js +0 -4
- package/dist/bundled/components/search/SearchItem.vue_vue_type_style_index_0_scoped_b819ed97_lang.js +0 -4
- package/dist/bundled/components/story/StoryResponsivePreview.vue_vue_type_style_index_0_scoped_1375d05a_lang.js +0 -4
- package/dist/bundled/components/story/StoryVariantGridItem.vue_vue_type_style_index_0_scoped_601cc357_lang.js +0 -4
- package/dist/bundled/components/story/StoryVariantListItem.vue_vue_type_style_index_0_scoped_02816158_lang.js +0 -4
- package/dist/bundled/components/story/StoryVariantSingle.vue_vue_type_style_index_0_scoped_89489ae4_lang.js +0 -4
- package/dist/bundled/components/story/StoryViewer.vue_vue_type_style_index_0_scoped_54d5a557_lang.js +0 -4
- package/dist/bundled/components/toolbar/ToolbarBackground.vue_vue_type_style_index_0_scoped_8d0cb17e_lang.js +0 -4
- package/dist/bundled/components/tree/StoryListFolder.vue_vue_type_style_index_0_scoped_41fb5f7e_lang.js +0 -4
- package/dist/bundled/components/tree/StoryListItem.vue_vue_type_style_index_0_scoped_d1a05247_lang.js +0 -4
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
2
|
import { Icon } from '@iconify/vue'
|
|
3
|
+
import { computed } from 'vue'
|
|
3
4
|
import { usePreviewSettingsStore } from '../../stores/preview-settings'
|
|
4
5
|
import { histoireConfig } from '../../util/config'
|
|
6
|
+
import { getContrastColor } from '../../util/preview-settings'
|
|
5
7
|
import BaseCheckbox from '../base/BaseCheckbox.vue'
|
|
6
8
|
|
|
7
9
|
const settings = usePreviewSettingsStore().currentSettings
|
|
10
|
+
|
|
11
|
+
const contrastColor = computed(() => getContrastColor(settings))
|
|
8
12
|
</script>
|
|
9
13
|
|
|
10
14
|
<template>
|
|
@@ -12,15 +16,18 @@ const settings = usePreviewSettingsStore().currentSettings
|
|
|
12
16
|
v-if="histoireConfig.backgroundPresets.length"
|
|
13
17
|
placement="bottom-end"
|
|
14
18
|
:skidding="6"
|
|
15
|
-
class="htw-h-full htw-flex-none"
|
|
19
|
+
class="histoire-toolbar-background htw-h-full htw-flex-none"
|
|
20
|
+
data-test-id="toolbar-background"
|
|
16
21
|
>
|
|
17
22
|
<div
|
|
18
23
|
v-tooltip="'Background color'"
|
|
19
24
|
class="htw-cursor-pointer hover:htw-text-primary-500 htw-flex htw-items-center htw-gap-1 htw-h-full htw-px-2 htw-group"
|
|
20
25
|
>
|
|
21
26
|
<div
|
|
22
|
-
class="bind-preview-bg htw-w-4 htw-h-4 htw-rounded-full htw-border htw-border-black/50 dark:htw-border-white/50"
|
|
23
|
-
|
|
27
|
+
class="bind-preview-bg htw-w-4 htw-h-4 htw-rounded-full htw-border htw-border-black/50 dark:htw-border-white/50 htw-flex htw-items-center htw-justify-center htw-text-xs"
|
|
28
|
+
>
|
|
29
|
+
<span v-if="contrastColor">a</span>
|
|
30
|
+
</div>
|
|
24
31
|
<Icon
|
|
25
32
|
icon="carbon:caret-down"
|
|
26
33
|
class="htw-w-4 htw-h-4 htw-opacity-50 group-hover:htw-opacity-100"
|
|
@@ -28,7 +35,10 @@ const settings = usePreviewSettingsStore().currentSettings
|
|
|
28
35
|
</div>
|
|
29
36
|
|
|
30
37
|
<template #popper="{ hide }">
|
|
31
|
-
<div
|
|
38
|
+
<div
|
|
39
|
+
class="htw-flex htw-flex-col htw-items-stretch"
|
|
40
|
+
data-test-id="background-popper"
|
|
41
|
+
>
|
|
32
42
|
<BaseCheckbox v-model="settings.checkerboard">
|
|
33
43
|
Checkerboard
|
|
34
44
|
</BaseCheckbox>
|
|
@@ -36,7 +46,7 @@ const settings = usePreviewSettingsStore().currentSettings
|
|
|
36
46
|
<button
|
|
37
47
|
v-for="(option, index) in histoireConfig.backgroundPresets"
|
|
38
48
|
:key="index"
|
|
39
|
-
class="htw-px-4 htw-py-3 htw-cursor-pointer htw-text-left htw-flex htw-gap-4"
|
|
49
|
+
class="htw-px-4 htw-py-3 htw-cursor-pointer htw-text-left htw-flex htw-items-baseline htw-gap-4"
|
|
40
50
|
:class="[
|
|
41
51
|
settings.backgroundColor === option.color
|
|
42
52
|
? 'htw-bg-primary-500 hover:htw-bg-primary-600 htw-text-white dark:htw-text-black'
|
|
@@ -48,11 +58,14 @@ const settings = usePreviewSettingsStore().currentSettings
|
|
|
48
58
|
<template v-if="option.color !== '$checkerboard'">
|
|
49
59
|
<span class="htw-ml-auto htw-opacity-70">{{ option.color }}</span>
|
|
50
60
|
<div
|
|
51
|
-
class="htw-w-4 htw-h-4 htw-rounded-full htw-border htw-border-black/20 dark:htw-border-white/20"
|
|
61
|
+
class="htw-w-4 htw-h-4 htw-rounded-full htw-border htw-border-black/20 dark:htw-border-white/20 htw-flex htw-items-center htw-justify-center htw-text-xs"
|
|
52
62
|
:style="{
|
|
53
63
|
backgroundColor: option.color,
|
|
64
|
+
color: option.contrastColor,
|
|
54
65
|
}"
|
|
55
|
-
|
|
66
|
+
>
|
|
67
|
+
<span v-if="option.contrastColor">a</span>
|
|
68
|
+
</div>
|
|
56
69
|
</template>
|
|
57
70
|
</button>
|
|
58
71
|
</div>
|
|
@@ -63,5 +76,6 @@ const settings = usePreviewSettingsStore().currentSettings
|
|
|
63
76
|
<style scoped>
|
|
64
77
|
.bind-preview-bg {
|
|
65
78
|
background-color: v-bind('settings.backgroundColor');
|
|
79
|
+
color: v-bind('contrastColor');
|
|
66
80
|
}
|
|
67
81
|
</style>
|
|
@@ -19,7 +19,7 @@ const sandboxUrl = computed(() => {
|
|
|
19
19
|
v-tooltip="'Open variant in new tab'"
|
|
20
20
|
:href="sandboxUrl"
|
|
21
21
|
target="_blank"
|
|
22
|
-
class="htw-flex htw-items-center htw-gap-1 htw-h-full htw-px-2 hover:htw-text-primary-500 htw-opacity-50 hover:htw-opacity-100 dark:hover:htw-text-primary-400 htw-text-gray-900 dark:htw-text-gray-100"
|
|
22
|
+
class="histoire-toolbar-new-tab htw-flex htw-items-center htw-gap-1 htw-h-full htw-px-2 hover:htw-text-primary-500 htw-opacity-50 hover:htw-opacity-100 dark:hover:htw-text-primary-400 htw-text-gray-900 dark:htw-text-gray-100"
|
|
23
23
|
>
|
|
24
24
|
<Icon
|
|
25
25
|
icon="carbon:launch"
|
|
@@ -13,7 +13,7 @@ const settings = usePreviewSettingsStore().currentSettings
|
|
|
13
13
|
placement="bottom-end"
|
|
14
14
|
:skidding="6"
|
|
15
15
|
:disabled="!histoireConfig.responsivePresets?.length"
|
|
16
|
-
class="htw-h-full htw-flex-none"
|
|
16
|
+
class="histoire-toolbar-responsive-size htw-h-full htw-flex-none"
|
|
17
17
|
>
|
|
18
18
|
<div
|
|
19
19
|
v-tooltip="'Responsive sizes'"
|
|
@@ -38,7 +38,7 @@ const settings = usePreviewSettingsStore().currentSettings
|
|
|
38
38
|
Rotate
|
|
39
39
|
</BaseCheckbox>
|
|
40
40
|
|
|
41
|
-
<div class="htw-flex htw-gap-2 htw-px-4 htw-py-3">
|
|
41
|
+
<div class="htw-flex htw-items-center htw-gap-2 htw-px-4 htw-py-3">
|
|
42
42
|
<input
|
|
43
43
|
v-model.number="settings.responsiveWidth"
|
|
44
44
|
v-tooltip="'Responsive width (px)'"
|
|
@@ -47,7 +47,7 @@ const settings = usePreviewSettingsStore().currentSettings
|
|
|
47
47
|
step="16"
|
|
48
48
|
placeholder="Auto"
|
|
49
49
|
>
|
|
50
|
-
<span class="htw-opacity-50"
|
|
50
|
+
<span class="htw-opacity-50">×</span>
|
|
51
51
|
<input
|
|
52
52
|
v-model.number="settings.responsiveHeight"
|
|
53
53
|
v-tooltip="'Responsive height (px)'"
|
|
@@ -8,7 +8,7 @@ const settings = usePreviewSettingsStore().currentSettings
|
|
|
8
8
|
<template>
|
|
9
9
|
<a
|
|
10
10
|
v-tooltip="`Switch to text direction ${settings.textDirection === 'ltr' ? 'Right to Left' : 'Left to Right'}`"
|
|
11
|
-
class="htw-flex htw-items-center htw-gap-1 htw-h-full htw-px-2 hover:htw-text-primary-500 htw-opacity-50 hover:htw-opacity-100 dark:hover:htw-text-primary-400 htw-text-gray-900 dark:htw-text-gray-100"
|
|
11
|
+
class="histoire-toolbar-text-direction htw-flex htw-items-center htw-gap-1 htw-h-full htw-px-2 hover:htw-text-primary-500 htw-opacity-50 hover:htw-opacity-100 dark:hover:htw-text-primary-400 htw-text-gray-900 dark:htw-text-gray-100"
|
|
12
12
|
@click="settings.textDirection = settings.textDirection === 'ltr' ? 'rtl' : 'ltr'"
|
|
13
13
|
>
|
|
14
14
|
<Icon
|
|
@@ -8,7 +8,7 @@ defineProps<{
|
|
|
8
8
|
</script>
|
|
9
9
|
|
|
10
10
|
<template>
|
|
11
|
-
<div class="htw-flex htw-items-center htw-gap-1 htw-text-gray-500 htw-flex-1 htw-truncate htw-min-w-0">
|
|
11
|
+
<div class="histoire-toolbar-title htw-flex htw-items-center htw-gap-1 htw-text-gray-500 htw-flex-1 htw-truncate htw-min-w-0">
|
|
12
12
|
<Icon
|
|
13
13
|
:icon="variant.icon ?? 'carbon:cube'"
|
|
14
14
|
class="htw-w-4 htw-h-4 htw-opacity-50"
|
|
File without changes
|
package/src/app/style/main.pcss
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
@import url('https://fonts.googleapis.com/css2?family=
|
|
1
|
+
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Display&display=swap');
|
|
2
2
|
@import 'floating-vue/dist/style.css';
|
|
3
3
|
@import '@histoire/controls/dist/style.css';
|
|
4
4
|
|
|
5
|
-
@import 'floating
|
|
5
|
+
@import 'floating.pcss';
|
|
6
6
|
@import 'transitions.pcss';
|
|
7
7
|
|
|
8
8
|
*,
|
|
@@ -37,61 +37,63 @@ button {
|
|
|
37
37
|
@tailwind components;
|
|
38
38
|
@tailwind utilities;
|
|
39
39
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
html,
|
|
46
|
-
body,
|
|
47
|
-
#app {
|
|
48
|
-
height: 100%;
|
|
49
|
-
}
|
|
40
|
+
@layer base {
|
|
41
|
+
body,
|
|
42
|
+
pre {
|
|
43
|
+
margin: 0;
|
|
44
|
+
}
|
|
50
45
|
|
|
51
|
-
html
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
46
|
+
html,
|
|
47
|
+
body,
|
|
48
|
+
#app {
|
|
49
|
+
height: 100%;
|
|
50
|
+
}
|
|
55
51
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
52
|
+
html {
|
|
53
|
+
font-family: 'Noto Sans Display', system-ui, sans-serif;
|
|
54
|
+
font-size: 1rem;
|
|
55
|
+
}
|
|
59
56
|
|
|
60
|
-
@media (min-width: 640px) {
|
|
61
57
|
body {
|
|
62
|
-
font-size: .
|
|
58
|
+
font-size: 1.125rem;
|
|
63
59
|
}
|
|
64
|
-
}
|
|
65
60
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
61
|
+
@media (min-width: 640px) {
|
|
62
|
+
body {
|
|
63
|
+
font-size: .875rem;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
69
66
|
|
|
70
|
-
.__histoire-
|
|
71
|
-
|
|
72
|
-
}
|
|
67
|
+
.__histoire-sandbox {
|
|
68
|
+
contain: content;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.__histoire-code .shiki {
|
|
72
|
+
background: transparent !important;
|
|
73
|
+
}
|
|
73
74
|
|
|
74
|
-
.htw-prose {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
75
|
+
.htw-prose {
|
|
76
|
+
h1, h2, h3, h4 {
|
|
77
|
+
&:not(:hover) {
|
|
78
|
+
.header-anchor[aria-hidden="true"] {
|
|
79
|
+
visibility: hidden;
|
|
80
|
+
}
|
|
79
81
|
}
|
|
80
82
|
}
|
|
81
|
-
}
|
|
82
83
|
|
|
83
|
-
|
|
84
|
-
|
|
84
|
+
hr {
|
|
85
|
+
margin: 1rem 0;
|
|
86
|
+
}
|
|
85
87
|
}
|
|
86
|
-
}
|
|
87
88
|
|
|
88
|
-
.__histoire-pane-shadow-from-right {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
89
|
+
.__histoire-pane-shadow-from-right {
|
|
90
|
+
background-image: linear-gradient(to left, rgba(0, 0, 0, 0.02), rgba(0, 0, 0, 0));
|
|
91
|
+
background-size: 24px;
|
|
92
|
+
background-repeat: no-repeat;
|
|
93
|
+
background-position: right;
|
|
93
94
|
|
|
94
|
-
|
|
95
|
-
|
|
95
|
+
.htw-dark & {
|
|
96
|
+
background-image: linear-gradient(to left, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0));
|
|
97
|
+
}
|
|
96
98
|
}
|
|
97
99
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { reactive } from 'vue'
|
|
2
|
+
import { histoireConfig } from './config'
|
|
2
3
|
import type { PreviewSettings } from '../types'
|
|
3
4
|
|
|
4
5
|
export const receivedSettings = reactive<PreviewSettings>({} as PreviewSettings)
|
|
@@ -6,5 +7,17 @@ export const receivedSettings = reactive<PreviewSettings>({} as PreviewSettings)
|
|
|
6
7
|
export function applyPreviewSettings (settings: PreviewSettings) {
|
|
7
8
|
Object.assign(receivedSettings, settings)
|
|
8
9
|
|
|
10
|
+
// Text direction
|
|
9
11
|
document.documentElement.setAttribute('dir', settings.textDirection)
|
|
12
|
+
|
|
13
|
+
// Contrast color
|
|
14
|
+
const contrastColor = getContrastColor(settings)
|
|
15
|
+
document.documentElement.style.setProperty('--histoire-contrast-color', contrastColor)
|
|
16
|
+
if (histoireConfig.autoApplyContrastColor) {
|
|
17
|
+
document.documentElement.style.color = contrastColor
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export function getContrastColor (setting: PreviewSettings) {
|
|
22
|
+
return histoireConfig.backgroundPresets.find(preset => preset.color === setting.backgroundColor)?.contrastColor ?? 'unset'
|
|
10
23
|
}
|
package/tailwind.config.cjs
CHANGED
|
@@ -58,7 +58,7 @@ module.exports = {
|
|
|
58
58
|
...inheritedConfig,
|
|
59
59
|
prefix: 'htw-',
|
|
60
60
|
content: [
|
|
61
|
-
'./src/**/*.{vue,js,ts,jsx,tsx,md}',
|
|
61
|
+
path.resolve(__dirname, './src/**/*.{vue,js,ts,jsx,tsx,md}'),
|
|
62
62
|
// Include controls CSS directly
|
|
63
63
|
path.resolve(__dirname, '../histoire-controls/src/**/*.{vue,js,ts,jsx,tsx,md}'),
|
|
64
64
|
],
|