Skip to content

Commit

Permalink
umputun#5 use css custom properties instead of color constant
Browse files Browse the repository at this point in the history
  • Loading branch information
Mavrin committed Feb 20, 2020
1 parent 390ecbe commit d106db6
Show file tree
Hide file tree
Showing 56 changed files with 562 additions and 297 deletions.
13 changes: 13 additions & 0 deletions frontend/.stylelintrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
const path = require('path');
module.exports = {
extends: ['stylelint-config-standard', 'stylelint-config-prettier'],
plugins: ['stylelint-value-no-unknown-custom-properties', '@mavrin/stylelint-declaration-use-css-custom-properties'],
rules: {
'max-empty-lines': 1,
'rule-empty-line-before': [
Expand All @@ -9,5 +11,16 @@ module.exports = {
ignore: ['after-comment'],
},
],
'mavrin/stylelint-declaration-use-css-custom-properties': {
cssDefinitions: ['color'],
ignoreProperties: ['/^\\$/'],
ignoreValues: ['/\\$/', 'transparent', '-webkit-focus-ring-color', 'currentColor'],
},
'csstools/value-no-unknown-custom-properties': [
true,
{
importFrom: path.resolve(__dirname, './app/custom-properties.css'),
},
],
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@

.auth-panel-email-login-form__token-input {
resize: vertical;
border: 1px solid #c4c4c4;
border: 1px solid var(--color31);
padding: 4px;
font-family: inherit;
font-size: 0.8em;
font-weight: normal;
line-height: 1.5;

&:focus {
box-shadow: 0 0 0 2px rgba(37, 156, 154, 0.4);
border-color: #259c9a;
box-shadow: 0 0 0 2px var(--color47);
border-color: var(--color15);
outline: none;
}
}
Expand Down Expand Up @@ -51,11 +51,11 @@
}

.auth-panel-email-login-form_theme_dark .auth-panel-email-login-form__error {
background: #672323;
color: #f98989;
background: var(--color28);
color: var(--color27);
}

.auth-panel-email-login-form_theme_light .auth-panel-email-login-form__error {
background: #ffd7d7;
color: #9a0000;
background: var(--color26);
color: var(--color25);
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.auth-panel_theme_dark {
.auth-panel__user-id {
color: #eee;
color: var(--color5);
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.auth-panel_theme_light {
.auth-panel__user-id {
color: #888;
color: var(--color13);
}
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
.avatar-icon_default {
border: 1px solid #9cdddb;
border: 1px solid var(--color40);
}
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
.button_kind_link {
background: transparent;
font-weight: bold;
color: #0aa;
color: var(--color9);

&:hover {
color: #06c5c5;
color: var(--color33);
}

&:disabled,
&:hover:disabled {
color: #0aa;
color: var(--color9);
}
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
.button_kind_primary {
background: #259c9a;
color: #fff;
background: var(--color15);
color: var(--color6);

&:hover {
background: #06c5c5;
background: var(--color33);
}

&:hover:disabled {
background: #259c9a;
background: var(--color15);
}
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
.button_kind_secondary {
background: #fff;
background: var(--color6);
color: inherit;

&:hover {
box-shadow: inset 0 0 0 2px #06c5c5;
box-shadow: inset 0 0 0 2px var(--color33);
}
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
.button_theme_dark.button_kind_secondary {
background: #22201c;
color: #ddd;
background: var(--color8);
color: var(--color20);
}

.button_theme_dark.button_kind_link {
&:disabled,
&:hover:disabled {
color: #fff;
color: var(--color6);
}
}
2 changes: 1 addition & 1 deletion frontend/app/components/button/button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
white-space: nowrap;

&:focus {
box-shadow: 0 0 0 2px rgba(37, 156, 154, 0.4);
box-shadow: 0 0 0 2px var(--color47);
outline: none;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.comment-form__button_type_preview {
&:hover,
&:focus {
box-shadow: inset 0 0 0 2px #0aa;
color: #099;
box-shadow: inset 0 0 0 2px var(--color9);
color: var(--color17);
}
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
.comment-form__button_type_send {
background: #259c9a;
color: #fff;
background: var(--color15);
color: var(--color6);

&:hover,
&:focus {
background: #0aa;
background: var(--color9);
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.comment-form__control-panel {
height: 30px;
background-color: #eee;
background-color: var(--color5);
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
bottom: 4px;
font-size: 10px;
font-weight: 700;
color: #ef0000;
color: var(--color38);
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@
transform: translateZ(0); /* let's try to fix blinking in Safari, again */

&:focus {
box-shadow: 0 0 0 2px rgba(37, 156, 154, 0.4);
border-color: #259c9a;
box-shadow: 0 0 0 2px var(--color47);
border-color: var(--color15);
outline: none;
}

&:disabled {
color: #777;
color: var(--color10);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
white-space: nowrap;
text-decoration: none;
cursor: pointer;
color: #0aa;
color: var(--color9);

&:hover {
color: #06c5c5;
color: var(--color33);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
.comment-form__toolbar-item {
background: none;
border: 0;
color: #586069;
color: var(--color37);
display: block;
float: left;
padding: 4px 5px;

&:hover {
color: #0aa;
color: var(--color9);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
white-space: nowrap;
text-decoration: none;
cursor: pointer;
color: #0aa;
color: var(--color9);

&:hover {
color: #06c5c5;
color: var(--color33);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,16 @@

.comment-form__subscribe-by-email__token-input {
resize: vertical;
border: 1px solid #c4c4c4;
border: 1px solid var(--color31);
padding: 4px;
font-family: inherit;
font-size: 0.8em;
font-weight: normal;
line-height: 1.5;

&:focus {
box-shadow: 0 0 0 2px rgba(37, 156, 154, 0.4);
border-color: #259c9a;
box-shadow: 0 0 0 2px var(--color47);
border-color: var(--color15);
outline: none;
}
}
Expand All @@ -56,11 +56,11 @@
}

.comment-form__subscribe-by-email_theme_dark .comment-form__subscribe-by-email__error {
background: #672323;
color: #f98989;
background: var(--color28);
color: var(--color27);
}

.comment-form__subscribe-by-email_theme_light .comment-form__subscribe-by-email__error {
background: #ffd7d7;
color: #9a0000;
background: var(--color26);
color: var(--color25);
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
white-space: nowrap;
text-decoration: none;
cursor: pointer;
color: #0aa;
color: var(--color9);

&:hover {
color: #06c5c5;
color: var(--color33);
}
}
Original file line number Diff line number Diff line change
@@ -1,50 +1,50 @@
.comment-form_theme_dark {
border-color: #333;
background: #22201c; /* try to fix textarea blinking in Safari */
border-color: var(--color7);
background: var(--color8); /* try to fix textarea blinking in Safari */

.comment-form__actions {
background: #333;
background: var(--color7);
}

.comment-form__button_type_preview {
background: #22201c;
color: #ddd;
background: var(--color8);
color: var(--color20);
}

.comment-form__button_type_send {
color: #ddd;
color: var(--color20);
}

.comment-form__error {
border-top: 8px solid #333;
background: #672323;
color: #f98989;
border-top: 8px solid var(--color7);
background: var(--color28);
color: var(--color27);
}

.comment-form__field {
background: #22201c;
color: #eee;
background: var(--color8);
color: var(--color5);
}

.comment-form__preview {
border-color: #22201c;
background: #22201c;
color: #ddd;
border-color: var(--color8);
background: var(--color8);
color: var(--color20);
}

.comment-form__preview-wrapper {
background: #333;
background: var(--color7);
}

.comment-form__toolbar-item {
color: #ddd;
color: var(--color20);

&:hover {
color: #0aa;
color: var(--color9);
}
}

.comment-form__control-panel {
background-color: #333;
background-color: var(--color7);
}
}
Loading

0 comments on commit d106db6

Please sign in to comment.