- {{ placeholder }}
+ {{ placeholder }}
{
const cssClasses: Array = []
if ((Object.values(InputTypes) as Array).includes(this.inputType)) {
- cssClasses.push(this.inputType)
+ cssClasses.push(`s-${this.inputType}-type`)
}
if (this.focused) {
- cssClasses.push('focused')
+ cssClasses.push('s-focused')
}
if (this.disabled) {
- cssClasses.push('disabled')
+ cssClasses.push('s-disabled')
}
if ((!this.multiple && this.model) || (this.multiple && this.model.length !== 0)) {
- cssClasses.push('has-value')
+ cssClasses.push('s-has-value')
}
return cssClasses
}
@@ -212,43 +212,43 @@ export default class SSelect extends Vue {
}
.el-input {
&.is-focus .el-input__inner {
- border-color: $color-neutral-placeholder;
+ border-color: $s-color-neutral-placeholder;
}
.el-input__inner {
&::placeholder {
- color: $color-neutral-secondary;
+ color: $s-color-neutral-secondary;
opacity: 1; // Firefox
}
}
.el-select__caret {
- color: $color-neutral-secondary;
+ color: $s-color-neutral-secondary;
}
}
}
- &.input {
+ &.s-input-type {
.el-select {
.el-input__inner {
- height: $size-big;
+ height: $s-size-big;
padding: 0 15px;
- border: 1px solid $color-neutral-placeholder;
- background-color: $color-neutral-placeholder;
+ border: 1px solid $s-color-neutral-placeholder;
+ background-color: $s-color-neutral-placeholder;
&:focus {
- border-color: $color-neutral-placeholder;
+ border-color: $s-color-neutral-placeholder;
}
}
}
&:hover {
.el-select {
.el-input__inner {
- border-color: $color-neutral-hover;
- background-color: $color-neutral-hover;
+ border-color: $s-color-neutral-hover;
+ background-color: $s-color-neutral-hover;
}
}
- .placeholder {
- background-color: $color-neutral-hover;
+ .s-placeholder {
+ background-color: $s-color-neutral-hover;
}
}
- .placeholder + .el-select {
+ .s-placeholder + .el-select {
.el-input__inner {
padding-top: 12px;
}
@@ -256,40 +256,40 @@ export default class SSelect extends Vue {
padding-top: 11px;
}
}
- &.focused {
+ &.s-focused {
.el-select {
.el-input__inner {
- border-color: $color-neutral-border;
- background-color: $color-basic-white;
+ border-color: $s-color-neutral-border;
+ background-color: $s-color-basic-white;
}
}
- .placeholder {
- background-color: $color-basic-white;
+ .s-placeholder {
+ background-color: $s-color-basic-white;
}
}
- &.disabled {
+ &.s-disabled {
.el-select {
.el-select__caret {
- color: $color-neutral-secondary;
+ color: $s-color-neutral-secondary;
}
.el-input__inner, .el-input__inner:hover {
- border-color: $color-neutral-border;
- color: $color-neutral-secondary;
- background-color: $color-neutral-placeholder;
+ border-color: $s-color-neutral-border;
+ color: $s-color-neutral-secondary;
+ background-color: $s-color-neutral-placeholder;
&::placeholder {
- color: $color-neutral-secondary;
+ color: $s-color-neutral-secondary;
}
}
}
- .placeholder {
- color: $color-neutral-secondary;
- background-color: $color-neutral-placeholder;
+ .s-placeholder {
+ color: $s-color-neutral-secondary;
+ background-color: $s-color-neutral-placeholder;
}
}
}
- .placeholder {
+ .s-placeholder {
// TODO: add default animation from material-ui
- color: $color-neutral-secondary;
+ color: $s-color-neutral-secondary;
text-align: left;
font-size: 12px;
padding: 0 15px;
@@ -300,63 +300,63 @@ export default class SSelect extends Vue {
position: absolute;
z-index: 1;
width: calc(100% - 15px);
- background-color: $color-neutral-placeholder;
+ background-color: $s-color-neutral-placeholder;
pointer-events: none;
}
- &.select {
+ &.s-select-type {
.el-select {
.el-input__inner {
border-radius: 8px;
padding-left: 12px;
font-weight: bold;
&:hover {
- border-color: $color-neutral-inactive;
+ border-color: $s-color-neutral-inactive;
}
&::placeholder {
- color: $color-neutral-tertiary;
+ color: $s-color-neutral-tertiary;
font-weight: bold;
}
&:focus {
- border-color: $color-neutral-inactive;
+ border-color: $s-color-neutral-inactive;
}
}
.el-select__caret {
- color: $color-neutral-tertiary;
+ color: $s-color-neutral-tertiary;
}
}
- &.focused {
+ &.s-focused {
.el-select {
.el-input__inner {
- color: $color-basic-black;
- border-color: $color-neutral-inactive;
+ color: $s-color-basic-black;
+ border-color: $s-color-neutral-inactive;
&::placeholder {
- color: $color-basic-black;
+ color: $s-color-basic-black;
}
}
.el-select__caret {
- color: $color-basic-black;
+ color: $s-color-basic-black;
}
}
}
- &.has-value {
+ &.s-has-value {
.el-select {
.el-select__caret {
- color: $color-basic-black;
+ color: $s-color-basic-black;
}
}
}
- &.disabled {
+ &.s-disabled {
.el-select {
.el-input__inner {
- color: $color-neutral-inactive;
- border-color: $color-neutral-border;
- background-color: $color-basic-white;
+ color: $s-color-neutral-inactive;
+ border-color: $s-color-neutral-border;
+ background-color: $s-color-basic-white;
&::placeholder {
- color: $color-neutral-inactive;
+ color: $s-color-neutral-inactive;
}
}
.el-select__caret {
- color: $color-neutral-inactive;
+ color: $s-color-neutral-inactive;
}
}
}
@@ -367,24 +367,24 @@ export default class SSelect extends Vue {
background-color: transparent;
}
&:hover {
- background-color: $color-neutral-placeholder;
+ background-color: $s-color-neutral-placeholder;
}
&.is-disabled {
- color: $color-neutral-inactive;;
+ color: $s-color-neutral-inactive;;
}
}
.el-select-dropdown.is-multiple .el-select-dropdown__item {
> span {
padding-left: 16px;
vertical-align: top;
- color: $color-basic-black;
+ color: $s-color-basic-black;
}
&::before {
font-family: "element-icons";
content: "\e6da";
- color: $color-basic-white;
- border: 1px solid $color-neutral-border;
- background-color: $color-basic-white;
+ color: $s-color-basic-white;
+ border: 1px solid $s-color-neutral-border;
+ background-color: $s-color-basic-white;
font-size: 16px;
font-weight: bold;
padding: 1px;
@@ -396,12 +396,12 @@ export default class SSelect extends Vue {
background-color: transparent;
}
&:hover {
- background-color: $color-neutral-placeholder;
+ background-color: $s-color-neutral-placeholder;
}
&::before {
- color: $color-basic-white;
- background-color: $color-main-brand;
- border-color: $color-main-brand;
+ color: $s-color-basic-white;
+ background-color: $s-color-main-brand;
+ border-color: $s-color-main-brand;
}
&::after {
content: '';
diff --git a/src/components/Tab/STabs.vue b/src/components/Tab/STabs.vue
index b2ef4019..6bf29610 100644
--- a/src/components/Tab/STabs.vue
+++ b/src/components/Tab/STabs.vue
@@ -97,7 +97,7 @@ export default class STabs extends Vue {
const cssClasses: Array = []
if (this.type === TabsType.ROUNDED &&
([TabsPosition.TOP, TabsPosition.BOTTOM] as Array).includes(this.position)) {
- cssClasses.push('rounded')
+ cssClasses.push('s-rounded')
}
return cssClasses
}
@@ -136,41 +136,41 @@ export default class STabs extends Vue {
}
}
&:not(.is-active) {
- color: $color-basic-black;
+ color: $s-color-basic-black;
}
}
.el-tab-pane {
- color: $color-basic-black;
+ color: $s-color-basic-black;
}
.el-tabs__nav-wrap::after {
- background-color: $color-neutral-placeholder;
+ background-color: $s-color-neutral-placeholder;
}
.el-tabs--card {
> .el-tabs__header {
- border-bottom-color: $color-neutral-hover;
+ border-bottom-color: $s-color-neutral-hover;
.el-tabs__nav {
- border-color: $color-neutral-hover;
+ border-color: $s-color-neutral-hover;
border-top-left-radius: 8px;
border-top-right-radius: 8px;
}
.el-tabs__item {
- border-left-color: $color-neutral-hover;
+ border-left-color: $s-color-neutral-hover;
}
}
}
.el-tabs--border-card {
- border-color: $color-neutral-border;
+ border-color: $s-color-neutral-border;
> .el-tabs__header {
- background-color: $color-neutral-placeholder;
- border-bottom-color: $color-neutral-border;
+ background-color: $s-color-neutral-placeholder;
+ border-bottom-color: $s-color-neutral-border;
}
}
- &.rounded {
+ &.s-rounded {
.el-tabs__header {
width: fit-content;
}
.el-tabs__nav-wrap {
- background-color: $color-neutral-placeholder;
+ background-color: $s-color-neutral-placeholder;
border-radius: 8px;
height: 32px;
padding-top: 2px;
@@ -187,7 +187,7 @@ export default class STabs extends Vue {
padding: 0 32px;
}
&.is-active {
- color: $color-basic-black;
+ color: $s-color-basic-black;
background-color: #FFFFFF;
box-shadow: 0px 3px 8px rgba(0, 0, 0, 0.12), 0px 3px 1px rgba(0, 0, 0, 0.04);
border-radius: 8px;
diff --git a/src/components/Table/STable.vue b/src/components/Table/STable.vue
index 2c15c19a..a5776490 100644
--- a/src/components/Table/STable.vue
+++ b/src/components/Table/STable.vue
@@ -365,7 +365,7 @@ export default class STable extends Vue {
@import "../../styles/variables.scss";
.el-table--enable-row-hover .el-table__body tr:hover > td {
- background-color: $color-neutral-hover;
+ background-color: $s-color-neutral-hover;
border-left: none;
border-right: none;
}
@@ -376,7 +376,7 @@ export default class STable extends Vue {
&.current-row > td,
&.el-table__row--striped > td,
&.el-table__row--striped.current-row > td {
- background-color: $color-neutral-hover;
+ background-color: $s-color-neutral-hover;
border-left: none;
border-right: none;
}
@@ -388,24 +388,24 @@ export default class STable extends Vue {
padding-left: 13px;
}
.el-table thead {
- color: $color-neutral-tertiary;
+ color: $s-color-neutral-tertiary;
}
.el-table--group,
.el-table--border,
.el-table th.is-leaf,
.el-table td,
.el-table--border th {
- border-color: $color-neutral-placeholder;
+ border-color: $s-color-neutral-placeholder;
}
.el-table--group::after,
.el-table--border::after {
- background-color: $color-neutral-placeholder;
+ background-color: $s-color-neutral-placeholder;
}
.el-table:not(.el-table--border)::before {
- background-color: $color-basic-white;
+ background-color: $s-color-basic-white;
}
.el-table tr:last-child td {
- border-bottom-color: $color-basic-white;
+ border-bottom-color: $s-color-basic-white;
}
.el-table__header {
label.el-checkbox.is-disabled {
@@ -462,6 +462,6 @@ export default class STable extends Vue {
}
.el-table__header-wrapper tbody td,
.el-table__footer-wrapper tbody td {
- background-color: $color-neutral-placeholder;
+ background-color: $s-color-neutral-placeholder;
}
diff --git a/src/components/Tooltip/STooltip.vue b/src/components/Tooltip/STooltip.vue
index 1cd77a70..ad1fe903 100644
--- a/src/components/Tooltip/STooltip.vue
+++ b/src/components/Tooltip/STooltip.vue
@@ -129,11 +129,11 @@ export default class STooltip extends Vue {
.el-tooltip__popper {
&.is-dark {
- background-color: $color-basic-black;
+ background-color: $s-color-basic-black;
}
&.is-light {
- color: $color-basic-black;
+ color: $s-color-basic-black;
}
- border-color: $color-basic-black;
+ border-color: $s-color-basic-black;
}
diff --git a/src/stories/Dropdown/SDropdown.stories.ts b/src/stories/Dropdown/SDropdown.stories.ts
index b28c813b..0a6962a4 100644
--- a/src/stories/Dropdown/SDropdown.stories.ts
+++ b/src/stories/Dropdown/SDropdown.stories.ts
@@ -81,7 +81,7 @@ export const differentTypes = () => ({
Different button types
-
+
({
Different button types with splitted button
-
+
({
:icon="type === 'action' ? 'back' : ''"
:type="type"
:size="size"
+ :rounded="rounded"
:alternative="alternative"
@click="handleClick"
>
@@ -37,6 +38,9 @@ export const configurable = () => ({
size: {
default: select('Size', Object.values(ButtonSize), ButtonSize.BIG)
},
+ rounded: {
+ default: boolean('Rounded', false)
+ },
alternative: {
default: boolean('Alternative', false)
},
diff --git a/src/styles/common.scss b/src/styles/common.scss
index dd3796c6..48a715da 100644
--- a/src/styles/common.scss
+++ b/src/styles/common.scss
@@ -22,16 +22,16 @@ html {
font-weight: bold;
}
-.big {
- height: $size-big;
+.s-big {
+ height: $s-size-big;
}
-.medium {
- height: $size-medium;
+.s-medium {
+ height: $s-size-medium;
}
-.small {
- height: $size-small;
+.s-small {
+ height: $s-size-small;
}
button > span {
@@ -70,25 +70,25 @@ button > span {
.el-message-box {
.el-message-box__header {
.el-message-box__title {
- color: $color-basic-black;
+ color: $s-color-basic-black;
font-size: 16px;
}
}
.el-message-box__btns {
button.el-button.el-button--default.el-button--small {
- height: $size-medium;
+ height: $s-size-medium;
font-size: 14px;
border-radius: 4px;
&:hover, &:active, &:focus {
- color: $color-main-brand;
- background-color: $color-basic-white;
- border-color: $color-main-brand;
+ color: $s-color-main-brand;
+ background-color: $s-color-basic-white;
+ border-color: $s-color-main-brand;
}
&.el-button--primary {
&:hover, &:active, &:focus {
- color: $color-basic-white;
- background-color: $color-main-hover;
- border-color: $color-main-hover;
+ color: $s-color-basic-white;
+ background-color: $s-color-main-hover;
+ border-color: $s-color-main-hover;
}
}
}
diff --git a/src/styles/element-variables.scss b/src/styles/element-variables.scss
index c008b6b0..ada8c48f 100644
--- a/src/styles/element-variables.scss
+++ b/src/styles/element-variables.scss
@@ -1,14 +1,14 @@
@import "./variables.scss";
-$--color-primary: $color-main-brand;
-$--color-danger: $color-error;
-$--border-color-base: $color-neutral-border;
-$--color-text-regular: $color-basic-black;
+$--color-primary: $s-color-main-brand;
+$--color-danger: $s-color-error;
+$--border-color-base: $s-color-neutral-border;
+$--color-text-regular: $s-color-basic-black;
/* Menu
--------------------------*/
// $--menu-background-color: $transparent;
-// $--menu-item-hover-fill: $color-basic-white;
+// $--menu-item-hover-fill: $s-color-basic-white;
/* icon font path, required */
$--font-path: "~element-ui/lib/theme-chalk/fonts";
diff --git a/src/styles/icons.scss b/src/styles/icons.scss
index 53039ba4..0bcd5135 100644
--- a/src/styles/icons.scss
+++ b/src/styles/icons.scss
@@ -9,7 +9,7 @@
line-height: 1;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
- color: $color-basic-black;
+ color: $s-color-basic-black;
}
$icons-font: 'soramitsu-icons' !important;
/*_____________________________________________Icons variables_____________________________________________*/
diff --git a/src/styles/variables.scss b/src/styles/variables.scss
index 5b688981..6f082b07 100644
--- a/src/styles/variables.scss
+++ b/src/styles/variables.scss
@@ -1,28 +1,28 @@
// Main colors
-$color-main-brand: #D0021B;
-$color-main-hover: #E75264;
-$color-main-inactive: #F6CCD1;
-$color-main-hover-light: #FEE6E7;
-$color-main-base: #FFF9FA;
+$s-color-main-brand: #D0021B !default;
+$s-color-main-hover: #E75264 !default;
+$s-color-main-inactive: #F6CCD1 !default;
+$s-color-main-hover-light: #FEE6E7 !default;
+$s-color-main-base: #FFF9FA !default;
// Neutral colors
-$color-neutral-primary: #53565A;
-$color-neutral-secondary: #75787B;
-$color-neutral-tertiary: #909296;
-$color-neutral-inactive: #C8C9C7;
-$color-neutral-border: #D9D9D6;
-$color-neutral-hover: #F0F0F0;
-$color-neutral-placeholder: #F1F3F4;
+$s-color-neutral-primary: #53565A !default;
+$s-color-neutral-secondary: #75787B !default;
+$s-color-neutral-tertiary: #909296 !default;
+$s-color-neutral-inactive: #C8C9C7 !default;
+$s-color-neutral-border: #D9D9D6 !default;
+$s-color-neutral-hover: #F0F0F0 !default;
+$s-color-neutral-placeholder: #F1F3F4 !default;
// UI events colors
-$color-error: #F0000B;
+$s-color-error: #F0000B !default;
// Basic colors
-$color-basic-black: #2D2926;
-$color-basic-white: #FFF;
+$s-color-basic-black: #2D2926 !default;
+$s-color-basic-white: #FFF !default;
// Size
-$size-big: 56px;
-$size-medium: 40px;
-$size-small: 32px;
+$s-size-big: 56px !default;
+$s-size-medium: 40px !default;
+$s-size-small: 32px !default;
-$border-radius-default: 4px;
+$s-border-radius-default: 4px !default;
// Fonts
@font-face {
font-family: "soramitsu-icons";