Skip to content

Commit

Permalink
refactor(theme): change final gray var name in case of naming conflic…
Browse files Browse the repository at this point in the history
…t [deploy docs]
  • Loading branch information
lejunyang committed Nov 6, 2024
1 parent 816f932 commit ec79533
Show file tree
Hide file tree
Showing 14 changed files with 34 additions and 4,190 deletions.
4 changes: 4 additions & 0 deletions .changeset/theme.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
---


## Changes

- change final gray var name in case of naming conflict

## Bug Fixes

- `theme/form-item`: fix vertical align issue of checkbox-group and radio-group in form-item
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ name: Packages build

on:
push:

branches:
- main
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
workflow_dispatch:
inputs:
run-id:
required: false
required: true
type: string
workflow_call:
inputs:
Expand Down
4 changes: 2 additions & 2 deletions packages/theme/src/custom/generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ export const importCustomDynamicColors = createImportDynamicStyle('common', (vm,
return getHostStyle([
...accentScale.map((c, i) => [getVarName('accent', i + 1), c] as const),
...accentScaleAlpha.map((c, i) => [getVarName('accent', 'a' + (i + 1)), c] as const),
...grayScale.map((c, i) => [getVarName('gray', i + 1), c] as const),
...grayScaleAlpha.map((c, i) => [getVarName('gray', 'a' + (i + 1)), c] as const),
...grayScale.map((c, i) => [getVarName('accent-gray', i + 1), c] as const),
...grayScaleAlpha.map((c, i) => [getVarName('accent-gray', 'a' + (i + 1)), c] as const),
[getVarName('color', 'surface', 'accent'), accentSurface],
[getVarName('accent', '9', 'contrast'), accentContrast],
[getVarName('color', 'focus'), accentScale[7]],
Expand Down
4,165 changes: 0 additions & 4,165 deletions packages/theme/src/scss/common/colors.scss

This file was deleted.

1 change: 0 additions & 1 deletion packages/theme/src/scss/common/index.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
@use '../mixins/config.scss' as *;
@use '../mixins/theme.scss' as *;

// @use './colors.scss' as *;
@use './keyframes.scss' as *;
@use './radius.scss' as *;
@use './shadow.scss' as *;
Expand Down
5 changes: 5 additions & 0 deletions packages/theme/src/scss/components/tabs/basic.scss
Original file line number Diff line number Diff line change
Expand Up @@ -177,3 +177,8 @@
);
}
}

// in case leaving element is hidden by isN(active)
.v-leave-active {
z-index: 1;
}
4 changes: 2 additions & 2 deletions packages/theme/src/scss/mixins/config.scss
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ $contrast-color-map: (
$color-name: 'color' !default;
$accent-name: 'accent' !default;
$default-accent-color: 'indigo' !default;
$gray-name: 'gray' !default;
$gray-color-name: #{$gray-name + '-color'} !default;
$gray-name: 'accent-gray' !default;
$gray-color-name: 'gray-color' !default;
$gray-color-list: ('mauve' 'slate' 'sage' 'olive' 'sand') !default;
$default-gray-color: 'slate' !default;
$status-color-map: (
Expand Down
2 changes: 1 addition & 1 deletion src/components/CompThemePanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export default defineComponent({
gridTemplateColumns: `auto repeat(${variants.length}, 1fr)`,
} as const;
const grayTipStyle = {
color: 'var(--l-gray-9)',
color: 'var(--l-accent-gray-9)',
fontSize: '12px',
whiteSpace: 'nowrap',
} as const;
Expand Down
6 changes: 3 additions & 3 deletions src/components/Palette.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<l-divider style="grid-column: span 12"></l-divider>
<span v-for="scale in scales" class="gray">{{ scale }}</span>
<div v-for="scale in scales" class="color-block" :style="`background-color: var(--l-accent-${scale});`"></div>
<div v-for="scale in scales" class="color-block" :style="`background-color: var(--l-gray-${scale});`"></div>
<div v-for="scale in scales" class="color-block" :style="`background-color: var(--l-accent-gray-${scale});`"></div>
</div>
<details class="details custom-block" style="text-align: start">
<summary>使用说明</summary>
Expand Down Expand Up @@ -149,11 +149,11 @@ h1 {
background: var(--l-color-picker-picked-color, var(--l-accent-a4));
cursor: pointer;
border-radius: var(--l-radius-4);
outline: 1px solid var(--l-gray-a8);
outline: 1px solid var(--l-accent-gray-a8);
outline-offset: 1px;
}
.gray {
color: var(--l-gray-9);
color: var(--l-accent-gray-9);
font-size: 12px;
}
h6 {
Expand Down
6 changes: 3 additions & 3 deletions src/components/ThemeConfigPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ const toggleAppearanceWithTransition = inject('toggle-appearance', () => {});
flex-direction: column;
gap: 10px;
.size-radio-label {
color: var(--l-gray-12);
color: var(--l-accent-gray-12);
}
.radius-radio {
&[data-checked] .wrapper {
Expand All @@ -130,7 +130,7 @@ const toggleAppearanceWithTransition = inject('toggle-appearance', () => {});
outline: 2px solid var(--l-accent-9);
}
.wrapper {
outline: 1px solid var(---l-gray-7);
outline: 1px solid var(---l-accent-gray-7);
padding: 12px;
}
}
Expand All @@ -145,7 +145,7 @@ const toggleAppearanceWithTransition = inject('toggle-appearance', () => {});
.radius-text {
text-align: center;
font-size: 14px;
color: var(--l-gray-9);
color: var(--l-accent-gray-9);
}
.radius-full {
border-start-start-radius: 80%;
Expand Down
4 changes: 2 additions & 2 deletions src/docs/components/popover/plugins.vue.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ export default () => (
<l-switch v-update-checked:checked={shift.value} />
</div>
<div class="w-full" style="height: 200px; overflow: auto;">
<div style="width: 1000px; height: 500px; position: relative; background-color: var(--l-gray-3);">
<div style="width: 1000px; height: 500px; position: relative; background-color: var(--l-accent-gray-3);">
<l-popover
style="position: absolute; top: 140px; left: 100px;"
open
type='normal'
type="normal"
flip={flip.value}
shift={shift.value}
>
Expand Down
6 changes: 3 additions & 3 deletions src/docs/components/scroll-view/_devViewScroll.vue
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const scroll = () => {
position: relative;
width: 100%;
overflow-y: auto;
border: 1px solid var(--l-gray-a8);
border: 1px solid var(--l-accent-gray-a8);
}
.block {
width: 100px;
Expand All @@ -70,13 +70,13 @@ const scroll = () => {
animation-range: v-bind(rangeStart) v-bind(rangeEnd);
}
.example {
outline: 1px dashed var(--l-gray-a8);
outline: 1px dashed var(--l-accent-gray-a8);
transform: translateX(200px);
}
.vline {
position: absolute;
width: 1px;
background: var(--l-gray-a8);
background: var(--l-accent-gray-a8);
top: 0;
height: 300px;
}
Expand Down
12 changes: 6 additions & 6 deletions src/docs/guides/usage/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ lang: zh-CN

目前只发布了 alpha 版本,提供以下库:

- `@lun-web/utils`:js 工具函数库
- `@lun-web/core`:提供组件功能的钩子函数库
- `@lun-web/plugins`: 为 JSX 或 Vue template 提供自定义指令
- `@lun-web/components`:组件库,其依赖于上面三个
- `@lun-web/theme`:主题库,其依赖于组件库
- `@lun-web/react`:为 react19 之前的版本封装的组件库,详细见下文[React 中使用](#react-中使用)
- [`@lun-web/utils`](https://www.npmjs.com/package/@lun-web/utils):js 工具函数库
- [`@lun-web/core`](https://www.npmjs.com/package/@lun-web/core):提供组件功能的钩子函数库
- [`@lun-web/plugins`](https://www.npmjs.com/package/@lun-web/plugins): 为 JSX 或 Vue template 提供自定义指令
- [`@lun-web/components`](https://www.npmjs.com/package/@lun-web/components):组件库,其依赖于上面三个
- [`@lun-web/theme`](https://www.npmjs.com/package/@lun-web/theme):主题库,其依赖于组件库
- [`@lun-web/react`](https://www.npmjs.com/package/@lun-web/react):为 react19 之前的版本封装的组件库,详细见下文[React 中使用](#react-中使用)

根据需要并安装对应的库

Expand Down

0 comments on commit ec79533

Please sign in to comment.