Skip to content

Commit

Permalink
fix: text color
Browse files Browse the repository at this point in the history
  • Loading branch information
CyanSalt committed Jul 17, 2023
1 parent 288f1ad commit 9c07561
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/components/icon.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ See [Text](/components/text).
</template>
<template #body:color:default>

`var(--r-common-text-color)` for `default` `type`, other theme colors for other `type`
`var(--r-text-color)`

</template>
<template #body:color:description>
Expand Down
4 changes: 3 additions & 1 deletion docs/components/text.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,9 @@ import { RSpace, RText } from 'roughness'
</template>
<template #body:color:default>

`var(--r-common-text-color)` for `default` `type`, other theme colors for other `type`
`var(--r-common-text-color)` for `default` `type`, other theme colors for other `type`.

When `type` is `default`, it will also be inherited from ancestors.

</template>
<template #body:color:description>
Expand Down
2 changes: 1 addition & 1 deletion src/icon/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ function draw(rc: RoughSVG, svg: SVGSVGElement) {

<style lang="scss" scoped>
.r-icon {
--r-icon-color: var(--r-common-text-color);
--r-icon-color: var(--r-text-color);
display: inline-block;
width: calc(1em + 4px);
height: calc(1em + 4px);
Expand Down
3 changes: 3 additions & 0 deletions src/text/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ defineSlots<{
.r-text {
--r-text-color: var(--r-common-text-color);
color: var(--r-text-color);
:where(.r-text) {
--r-text-color: inherit;
}
&.primary {
--r-text-color: var(--r-common-primary-color);
}
Expand Down

0 comments on commit 9c07561

Please sign in to comment.