From e99a2c2d252354f44939b8bd290d43c29e325b42 Mon Sep 17 00:00:00 2001 From: upsiflu Date: Sun, 22 Dec 2024 21:22:55 +0100 Subject: [PATCH] chore(ui-docs): general improvements --- front/ui-docs/.vitepress/theme/Theme.vue | 2 + front/ui-docs/components/ui/button.md | 64 ++++++++++++++++++++---- front/ui-docs/using-color.md | 46 +++-------------- 3 files changed, 62 insertions(+), 50 deletions(-) diff --git a/front/ui-docs/.vitepress/theme/Theme.vue b/front/ui-docs/.vitepress/theme/Theme.vue index b7b451a60..1b7dfa857 100644 --- a/front/ui-docs/.vitepress/theme/Theme.vue +++ b/front/ui-docs/.vitepress/theme/Theme.vue @@ -35,6 +35,8 @@ const { Theme } = DefaultTheme padding: 16px 0; flex-grow: 1; border-radius: 8px; + justify-content: center; + --vp-code-block-bg: transparent; &:not(.transparent){ background-color:var(--background-color); diff --git a/front/ui-docs/components/ui/button.md b/front/ui-docs/components/ui/button.md index 4a09d6853..39b03665a 100644 --- a/front/ui-docs/components/ui/button.md +++ b/front/ui-docs/components/ui/button.md @@ -41,7 +41,9 @@ Find [a complete overview of recommended styles on the color page](../../using-c ### Default - + + +
```vue-html ``` - - - +
+ +
### Primary -Primary buttons represent **positive** actions such as uploading, confirming, and accepting changes. +The primary button represents the **single positive** action on a page or modal, such as uploading, confirming, and accepting changes. + + + +
```vue-html ``` +
+ +
+ ### Secondary Secondary buttons represent **neutral** actions such as cancelling a change or dismissing a notification. + + +
+ ```vue-html - ``` -
+ + +
+ +Note that on a secondary background, the button needs to be `raised` to make it stand out. + ### Destructive Desctrutive buttons represent **dangerous** actions including deleting items or purging domain information. + + +
+ ```vue-html ``` +
+ +
+ ## Button variants Buttons come in different styles that you can use depending on the location of the button. @@ -225,7 +253,7 @@ This can be useful for toggle buttons (if you don't want to use a [Toggle compo ``` -**Secondary (default):** +**Default:** + + + +--- + **Primary:** + + ### Promise handling in `@click` When a function passed to `@click` returns a promise, the button automatically toggles a loading state on click. When the promise resolves or is rejected, the loading state turns off. diff --git a/front/ui-docs/using-color.md b/front/ui-docs/using-color.md index b5ed0dfe3..49c036879 100644 --- a/front/ui-docs/using-color.md +++ b/front/ui-docs/using-color.md @@ -22,8 +22,8 @@ Want to fix colors? Modify a specific variant
- + # Using Color ## Add color via props @@ -445,40 +445,6 @@ Many browsers automatically turn on "night mode" to lower the light emission of In both "dark mode" and "light mode", the colors must provide adequate contrast and consistency. -All colors added through the `color` or the `propsToColor` function in `composable/colors.ts` respect this setting. If you need to define new colors, use the following syntax in your `scss`: - -```scss -@include light-theme { - --my-new-color: var(--fw-blue-400); -} -@include dark-theme { - --my-new-color: var(--fw-blue-800); -} -``` - -It's good practice to limit the scope of a variable to the module that needs it: - -```vue - - - -``` - Read more about [style modules in the corresponding vue docs](https://vuejs.org/api/sfc-css-features.html#css-modules). For testing purposes and side-by-side comparisons, you can add the classes `force-dark-theme` and `force-light-theme`. @@ -650,7 +616,7 @@ Here is the meaning the styles should convey: - + @@ -692,7 +658,7 @@ Here is the meaning the styles should convey: - + @@ -734,7 +700,7 @@ Here is the meaning the styles should convey: - + @@ -776,7 +742,7 @@ Here is the meaning the styles should convey: - + @@ -786,7 +752,7 @@ Here is the meaning the styles should convey: - +