Skip to content

Commit

Permalink
enhance: replace missing colors with css variables. fix ant-design#6319
Browse files Browse the repository at this point in the history
… (ant-design#6320)

* enhance: replace missing colors with css variables. fix ant-design#6319

* enhance: replace black color with css variable

* chore: update tag snapshots for css var
  • Loading branch information
cytle authored Aug 15, 2023
1 parent 6b21558 commit 8a3f426
Show file tree
Hide file tree
Showing 11 changed files with 17 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/components/action-sheet/action-sheet.less
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
background-color: var(--adm-color-background);
padding: 16px;
&:active {
background-color: #eeeeee;
background-color: var(--adm-color-border);
}
&-disabled {
cursor: not-allowed;
Expand Down
5 changes: 3 additions & 2 deletions src/components/button/button.less
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,9 @@
);
width: 100%;
height: 100%;
background-color: #000;
border: var(--border-width) var(--border-style) #000;
background-color: var(--adm-color-text-dark-solid);
border: var(--border-width) var(--border-style)
var(--adm-color-text-dark-solid);
border-radius: var(--border-radius);
opacity: 0;
content: ' ';
Expand Down
2 changes: 1 addition & 1 deletion src/components/error-block/error-block.less
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

&-description {
font-size: var(--adm-font-size-4);
color: #999;
color: var(--adm-color-weak);
line-height: 1.4;
margin-top: 12px;
&-title {
Expand Down
2 changes: 1 addition & 1 deletion src/components/form/form.less
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@

.adm-form-list-operation {
text-align: center;
color: #1677ff;
color: var(--adm-color-primary);
}
2 changes: 1 addition & 1 deletion src/components/image-uploader/image-uploader.less
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
display: block;

&-icon {
color: #999999;
color: var(--adm-color-weak);
font-size: 32px;
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/components/notice-bar/notice-bar.less
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

.@{class-prefix-notice-bar} {
--background-color: #ababab;
--border-color: #999999;
--border-color: var(--adm-color-weak);
--text-color: var(--adm-color-text-light-solid);
--font-size: var(--adm-font-size-7);
--icon-font-size: var(--adm-font-size-10);
Expand Down Expand Up @@ -38,7 +38,7 @@
&.@{class-prefix-notice-bar}-info {
--background-color: #d0e4ff;
--border-color: #bcd8ff;
--text-color: #1677ff;
--text-color: var(--adm-color-primary);
}

& .@{class-prefix-notice-bar}-left {
Expand Down
4 changes: 2 additions & 2 deletions src/components/number-keyboard/number-keyboard.less
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@
left: 50%;
width: 100%;
height: 100%;
background-color: #000;
background-color: var(--adm-color-text-dark-solid);
border: inherit;
border-color: #000;
border-color: var(--adm-color-text-dark-solid);
border-radius: inherit;
transform: translate(-50%, -50%);
opacity: 0;
Expand Down
4 changes: 2 additions & 2 deletions src/components/popover/popover-menu.less
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.adm-popover-menu {
--border-color: #eeeeee;
--border-color: var(--adm-color-border);

&.adm-popover {
--content-padding: 0;
Expand Down Expand Up @@ -52,7 +52,7 @@

.adm-popover.adm-popover-dark {
&.adm-popover-menu {
--border-color: #333333;
--border-color: var(--adm-color-text);
--background: rgba(0, 0, 0, 0.9);
}
}
2 changes: 1 addition & 1 deletion src/components/progress-bar/progress-bar.less
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
flex: none;
width: calc(var(--text-width) + 8px);
padding-left: 8px;
color: #999999;
color: var(--adm-color-weak);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/components/tag/tag.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import classNames from 'classnames'
const classPrefix = `adm-tag`

const colorRecord: Record<string, string> = {
default: '#666666',
default: 'var(--adm-color-text-secondary, #666666)',
primary: 'var(--adm-color-primary, #1677ff)',
success: 'var(--adm-color-success, #00b578)',
warning: 'var(--adm-color-warning, #ff8f1f)',
Expand Down
4 changes: 2 additions & 2 deletions src/components/tag/tests/__snapshots__/tag.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ exports[`Tag renders with fill 1`] = `
<div>
<span
class="adm-tag"
style="--border-color: #666666; --text-color: #666666; --background-color: transparent;"
style="--border-color: var(--adm-color-text-secondary, #666666); --text-color: var(--adm-color-text-secondary, #666666); --background-color: transparent;"
>
outline
</span>
<span
class="adm-tag"
style="--border-color: #666666; --text-color: #ffffff; --background-color: #666666;"
style="--border-color: var(--adm-color-text-secondary, #666666); --text-color: #ffffff; --background-color: var(--adm-color-text-secondary, #666666);"
>
solid
</span>
Expand Down

0 comments on commit 8a3f426

Please sign in to comment.