Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(components): update palette and othe tokens #69

Merged
merged 2 commits into from
Aug 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions packages/components/src/components/link/style/index.less
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@import '../../../stylesheet/theme.less';
@import '~@gio-design/tokens/dist/variables.less';
@import '../../../stylesheet/index.less';

@gio-link-prefix: ~'@{component-prefix}-link';
@gio-link-disabled: ~'@{gio-link-prefix}--disabled';
Expand All @@ -8,32 +9,32 @@
display: inline-block;
margin-right: 8px;
margin-left: 8px;
color: #1248e9;
color: @color-text-link-normal;
font-size: 14px;
line-height: 22px;
text-decoration: underline;
vertical-align: middle;
cursor: pointer;

&:hover {
color: @gr-link-color;
color: @color-text-link-hover;
text-decoration: underline;
}

&:active {
color: #313e75;
color: @color-text-link-click;
}
}

// disabled
.@{gio-link-disabled} {
color: #adb2c2;
color: @color-text-link-disable;
cursor: not-allowed;

&.@{gio-link-prefix} {
&:hover,
&:active {
color: #adb2c2;
color: @color-text-link-disable;
text-decoration: underline;
}
}
Expand Down
32 changes: 11 additions & 21 deletions packages/components/src/components/radio/style/index.less
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
@import '../../../stylesheet/theme.less';
@import '../../../stylesheet/mixin/index.less';

@color-primary: #3867f4;
@color-text: #313e75;

@color-background-normal: #ffffff;
@color-background-disabled: #f7f8fc;

@color-border-normal: #a3adc8;
@color-border-checked: #1248e9;
@color-border-disabled: #dfe2ed;
@import '~@gio-design/tokens/dist/variables.less';
@import '../../../stylesheet/index.less';

@radio-duration: 0.3s;
@radio-normal-shadow: inset -0.5px 1px 2px 0 rgba(163, 173, 200, 0.8);
Expand All @@ -32,7 +22,7 @@
&:not(&--disabled):hover {
& :not(.@{gio-radio-checked}) {
.@{gio-radio-prefix}-inner {
border-color: @color-primary;
border-color: @color-border-checkbox-hover;
box-shadow: @radio-hover-shadow;
}
}
Expand Down Expand Up @@ -73,7 +63,7 @@
& + * {
display: inline-block;
padding: 0 8px;
color: @color-text;
color: @color-text-checkbox-secondary-normal;
font-size: 14px;
line-height: 22px;
vertical-align: middle;
Expand All @@ -86,9 +76,9 @@
bottom: -50%;
left: -50%;
display: block;
background-color: @color-background-normal;
background-color: @color-background-checkbox-normal;
border: 0.5px solid;
border-color: @color-border-normal;
border-color: @color-border-checkbox-normal;
border-style: solid;
border-width: 1px;
border-radius: 50%;
Expand All @@ -104,7 +94,7 @@
width: 5px;
height: 5px;
margin: auto;
background-color: @color-background-normal;
background-color: @color-background-checkbox-normal;
border-radius: 50%;
box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.2);
transform: scale(0) translate(-25%, -25%);
Expand All @@ -118,8 +108,8 @@
// checked
.@{gio-radio-checked} {
.@{gio-radio-inner} {
background-color: @color-primary;
border-color: @color-border-checked;
background-color: @color-background-checkbox-active;
border-color: @color-border-checkbox-active;
box-shadow: none;
&::after {
transform: scale(2) translate(-25%, -25%);
Expand All @@ -137,8 +127,8 @@
}

.@{gio-radio-inner} {
background-color: @color-background-disabled;
border-color: @color-border-disabled;
background-color: @color-background-checkbox-disable;
border-color: @color-border-checkbox-disable;
box-shadow: none;

&::after {
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/components/sign/style/index.less
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@import '~@gio-design/tokens/dist/variables.less';
@import '../../../stylesheet/theme.less';
@import '../../../stylesheet/index.less';
@import './mixin.less';

@gio-sign: ~'@{component-prefix}-sign';
Expand Down
3 changes: 3 additions & 0 deletions packages/components/src/stylesheet/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@
@import './fontSize.less';
@import './radius.less';
@import './shadow.less';

// The prefix to use for components classes
@component-prefix: 'gio';
24 changes: 22 additions & 2 deletions packages/tokens/properties/color/background.json
Original file line number Diff line number Diff line change
Expand Up @@ -216,17 +216,37 @@
"value": "{palette.red.3.value}"
},
"normal": {
"value": "rgba(0, 191, 180, 1)"
"value": "{palette.green.5.value}"
},
"warning": {
"value": "rgb(237, 144, 20, 1)"
"value": "{palette.yellow.5.value}"
},
"error": {
"value": "{palette.red.3.value}"
},
"disabled": {
"value": "{palette.gray.5.value}"
}
},
"checkbox": {
"normal": {
"value": "{palette.white.value}"
},
"hover": {
"value": "{palette.white.value}"
},
"active": {
"value": "{palette.blue.5.value}"
},
"partCheck": {
"value": "{palette.blue.5.value}"
},
"disable": {
"value": "{palette.gray.3.value}"
},
"checkedDisable": {
"value": "{palette.gray.3.value}"
}
}
}
}
Expand Down
20 changes: 20 additions & 0 deletions packages/tokens/properties/color/border.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,26 @@
"value": "0.5px solid rgba(56, 103, 244, 0.5)"
}
}
},
"checkbox": {
"normal": {
"value": "{palette.gray.7.value}"
},
"hover": {
"value": "{palette.blue.5.value}"
},
"active": {
"value": "{palette.blue.5.value}"
},
"partCheck": {
"value": "{palette.blue.5.value}"
},
"disable": {
"value": "{palette.gray.4.value}"
},
"checkedDisable": {
"value": "{palette.gray.4.value}"
}
}
}
}
Expand Down
97 changes: 97 additions & 0 deletions packages/tokens/properties/color/text.json
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,103 @@
"content": {
"value": "{palette.dark.1.value}"
}
},
"checkbox": {
"primary": {
"normal": {
"value": "{palette.white.value}"
},
"hover": {
"value": "{palette.white.value}"
},
"click": {
"value": "{palette.white.value}"
},
"disable": {
"value": "{palette.black.2.value}"
}
},
"secondary": {
"normal": {
"value": "{palette.black.6.value}"
},
"hover": {
"value": "{palette.black.6.value}"
},
"click": {
"value": "{palette.black.6.value}"
},
"disable": {
"value": "{palette.black.2.value}"
}
},
"subtle": {
"a": {
"normal": {
"value": "{palette.black.6.value}"
},
"hover": {
"value": "{palette.black.6.value}"
},
"click": {
"value": "{palette.black.6.value}"
},
"disable": {
"value": "{palette.black.2.value}"
}
},
"b": {
"normal": {
"value": "{palette.blue.4.value}"
},
"hover": {
"value": "{palette.blue.5.value}"
},
"click": {
"value": "{palette.blue.3.value}"
},
"disable": {
"value": "{palette.black.2.value}"
}
}
}
},
"link": {
"normal": {
"value": "{palette.blue.5.value}"
},
"hover": {
"value": "{palette.blue.6.value}"
},
"click": {
"value": "{palette.blue.4.value}"
},
"disable": {
"value": "{palette.black.2.value}"
},
"contrast": {
"value": "{palette.white.value}"
}
},
"menu": {
"normal": {
"value": "{palette.black.7.value}"
},
"hover": {
"value": "{palette.black.7.value}"
},
"click": {
"value": "{palette.black.7.value}"
},
"active": {
"value": "{palette.blue.5.value}"
},
"disable": {
"value": "{palette.black.2.value}"
},
"subMenu": {
"value": "{palette.black.3.value}"
}
}
}
}
Expand Down
Loading