Skip to content

Commit

Permalink
fix: color and size
Browse files Browse the repository at this point in the history
  • Loading branch information
CyanSalt committed Apr 12, 2024
1 parent 4e07c29 commit e427c95
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 18 deletions.
2 changes: 1 addition & 1 deletion docs/components/avatar.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ const name = ref('Cameron')

<template #default-value>

`var(--r-common-comment-color)`
`var(--r-common-color)`

</template>

Expand Down
12 changes: 0 additions & 12 deletions docs/components/color-picker.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,18 +110,6 @@ let color = ref('')

<template #name="{ value }">--r-color-picker-{{ value }}</template>

<RStyle name="current-color">

<template #values>

`<color>`

</template>

Value of the color picker.

</RStyle>

<RStyle name="color">

<template #values>
Expand Down
2 changes: 1 addition & 1 deletion docs/components/rate.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ import { RRate } from 'roughness'

<template #default-value>

`var(--r-common-line-height)`
`calc(1em + 4px)`

</template>

Expand Down
28 changes: 28 additions & 0 deletions docs/guide/theme.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,34 @@ body {
}
```

The following properties (of colors) are effective for the **text content**:

<RStylesTable>

<template #name="{ value }">--r-element-{{ value }}</template>

<RStyle name="color">

<template #values>

`<color>`

</template>

<template #default-value>

`var(--r-common-color)`

</template>

Color of the element. Usually it will be changed by the `type` property of components.

See also [Color Styles](#color-styles).

</RStyle>

</RStylesTable>

Common style properties are declared under the root node. Changing them will affect all components.

<RStylesTable>
Expand Down
2 changes: 1 addition & 1 deletion src/avatar/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ function draw(rc: RoughSVG, svg: SVGSVGElement) {
.r-avatar {
--r-avatar-size: 2em;
--r-avatar-border-color: var(--r-common-comment-color);
--r-avatar-border-color: var(--r-common-color);
--r-avatar-border-width: 1px;
--r-avatar-border-dash: none;
block-size: var(--r-avatar-size);
Expand Down
1 change: 0 additions & 1 deletion src/color-picker/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ const style = $computed(() => {
@use '../common/_reset';
.r-color-picker {
--r-color-picker-current-color: var(--r-element-color);
--r-color-picker-color: var(--r-common-color);
--r-color-picker-border-width: 1px;
--r-color-picker-border-dash: none;
Expand Down
2 changes: 1 addition & 1 deletion src/rate/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ watchEffect(() => {
.r-rate {
--r-rate-color: var(--r-common-primary-color);
--r-rate-control-size: calc(var(--r-common-font-size) + 4px);
--r-rate-control-size: calc(1em + 4px);
--r-rate-gap-size: 4px;
display: inline-flex;
flex-direction: row-reverse;
Expand Down
2 changes: 1 addition & 1 deletion src/upload/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ function change(event: InputEvent) {
@use '../common/_partials';
.r-upload {
--r-upload-color: var(--r-element-color);
--r-upload-color: var(--r-common-color);
--r-upload-border-color: var(--r-upload-color);
--r-upload-border-width: 1px;
--r-upload-border-dash: 8px;
Expand Down

0 comments on commit e427c95

Please sign in to comment.