Skip to content

Commit 3382105

Browse files
authored
Merge pull request #3853 from nebulab/kennyadsl/remove-deprecated-variables-usage
Remove deprecated sass color-#{state} variables usage
2 parents 9eadf85 + 4bf5d7e commit 3382105

6 files changed

Lines changed: 76 additions & 39 deletions

File tree

backend/app/assets/stylesheets/spree/backend/_bootstrap_custom.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ $secondary: $color-dark-accent !default;
1313
$blue: $color-primary !default;
1414
$red: $color-red !default;
1515
$orange: $color-yellow !default;
16-
$green: $color-success !default;
16+
$green: $color-green !default;
1717

1818
// Body
1919
//

backend/app/assets/stylesheets/spree/backend/components/_actions.scss

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,65 @@
1+
$color-action-success-bg: theme-color-level(success, -10) !default;
2+
$color-action-success-brd: theme-color-level(success, -9) !default;
3+
$color-action-warning-bg: theme-color-level(warning, -10) !default;
4+
$color-action-warning-brd: theme-color-level(warning, -9) !default;
5+
$color-action-danger-bg: theme-color-level(danger, -10) !default;
6+
$color-action-danger-brd: theme-color-level(danger, -9) !default;
7+
8+
$color-action-edit-bg: $color-action-success-bg !default;
9+
$color-action-edit-brd: $color-action-success-brd !default;
10+
$color-action-clone-bg: $color-action-warning-bg !default;
11+
$color-action-clone-brd: $color-action-warning-brd !default;
12+
$color-action-remove-bg: $color-action-danger-bg !default;
13+
$color-action-remove-brd: $color-action-danger-brd !default;
14+
$color-action-void-bg: $color-action-danger-bg !default;
15+
$color-action-void-brd: $color-action-danger-brd !default;
16+
$color-action-cancel-bg: $color-action-warning-bg !default;
17+
$color-action-cancel-brd: $color-action-warning-brd !default;
18+
$color-action-capture-bg: $color-action-success-bg !default;
19+
$color-action-capture-brd: $color-action-success-brd !default;
20+
$color-action-save-bg: $color-action-success-bg !default;
21+
$color-action-save-brd: $color-action-success-brd !default;
22+
$color-action-mail-bg: $color-action-success-bg !default;
23+
$color-action-mail-brd: $color-action-success-brd !default;
24+
$color-action-failure-bg: $color-action-danger-bg !default;
25+
$color-action-failure-brd: $color-action-danger-brd !default;
26+
27+
$actions: (
28+
edit,
29+
clone,
30+
remove,
31+
void,
32+
capture,
33+
save,
34+
cancel,
35+
mail,
36+
failure
37+
) !default;
38+
39+
$actions-bg-colors: (
40+
$color-action-edit-bg,
41+
$color-action-clone-bg,
42+
$color-action-remove-bg,
43+
$color-action-void-bg,
44+
$color-action-capture-bg,
45+
$color-action-save-bg,
46+
$color-action-cancel-bg,
47+
$color-action-mail-bg,
48+
$color-action-failure-bg
49+
) !default;
50+
51+
$actions-brd-colors: (
52+
$color-action-edit-brd,
53+
$color-action-clone-brd,
54+
$color-action-remove-brd,
55+
$color-action-void-brd,
56+
$color-action-capture-brd,
57+
$color-action-save-brd,
58+
$color-action-cancel-brd,
59+
$color-action-mail-brd,
60+
$color-action-failure-brd
61+
) !default;
62+
163
table tbody tr {
264
&.highlight {
365

backend/app/assets/stylesheets/spree/backend/components/_messages.scss

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,16 @@
4444
color: $body-color;
4545

4646
&.notice {
47-
background-color: rgba(lighten($color-notice, 15), .95);
48-
border-top-color: $color-notice;
47+
background-color: rgba(theme-color-level(warning, -8), .95);
48+
border-top-color: theme-color(warning);
4949
}
5050
&.success {
51-
background-color: rgba(lighten($color-success, 30), .95);
52-
border-top-color: $color-success;
51+
background-color: rgba(theme-color-level(success, -10), .95);
52+
border-top-color: theme-color(success);
5353
}
5454
&.error {
55-
background-color: rgba(lighten($color-error, 30), .95);
56-
border-top-color: $color-error;
55+
background-color: rgba(theme-color-level(danger, -8), .95);
56+
border-top-color: theme-color(danger);
5757
}
5858
}
5959

backend/app/assets/stylesheets/spree/backend/globals/_deprecation.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ $output-solidus-deprecation-warnings: true !default;
1111
@if $output-solidus-deprecation-warnings == true {
1212
@if global-variable-exists($variable) {
1313
@warn "[Solidus] [Deprecation] `$#{$variable}` is deprecated and will be " +
14-
"removed in 3.0.0. Please use Bootstraps $#{$replacement} instead";
14+
"removed in 3.0.0. Please use Bootstraps #{$replacement} instead";
1515
}
1616
}
1717
}

backend/app/assets/stylesheets/spree/backend/globals/_variables.scss

Lines changed: 3 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,11 @@ $color-tab-active-bg: $color-white !default;
6262
$color-tab-active-border: $color-white !default;
6363

6464
// Basic flash colors
65-
@include bs-deprecated-variable("color-success", "brand-success");
65+
@include bs-deprecated-variable("color-success", "theme-color(success)");
6666
$color-success: $color-green !default;
67-
@include bs-deprecated-variable("color-notice", "brand-warning");
67+
@include bs-deprecated-variable("color-notice", "theme-color(warning)");
6868
$color-notice: $color-yellow !default;
69-
@include bs-deprecated-variable("color-error", "brand-danger");
69+
@include bs-deprecated-variable("color-error", "theme-color(danger)");
7070
$color-error: $color-red !default;
7171

7272
// Breadcrumb custom variable
@@ -113,26 +113,6 @@ $color-pill-warning-text: $color-pill-text;
113113
$color-pill-error: #ff967b;
114114
$color-pill-error-text: $color-pill-text;
115115

116-
// Actions colors
117-
$color-action-edit-bg: lighten($color-success, (5 * 5) ) !default;
118-
$color-action-edit-brd: lighten($color-success, (20 * 5) ) !default;
119-
$color-action-clone-bg: lighten($color-notice, (5 * 5) ) !default;
120-
$color-action-clone-brd: lighten($color-notice, (15 * 5) ) !default;
121-
$color-action-remove-bg: lighten($color-error, (5 * 5) ) !default;
122-
$color-action-remove-brd: lighten($color-error, (10 * 5) ) !default;
123-
$color-action-void-bg: lighten($color-error, (10 * 5) ) !default;
124-
$color-action-void-brd: lighten($color-error, (20 * 5) ) !default;
125-
$color-action-cancel-bg: lighten($color-notice, (10 * 5) ) !default;
126-
$color-action-cancel-brd: lighten($color-notice, (20 * 5) ) !default;
127-
$color-action-capture-bg: lighten($color-success, (5 * 5) ) !default;
128-
$color-action-capture-brd: lighten($color-success, (20 * 5) ) !default;
129-
$color-action-save-bg: lighten($color-success, (5 * 5) ) !default;
130-
$color-action-save-brd: lighten($color-success, (20 * 5) ) !default;
131-
$color-action-mail-bg: lighten($color-success, (5 * 5) ) !default;
132-
$color-action-mail-brd: lighten($color-success, (20 * 5) ) !default;
133-
$color-action-failure-bg: lighten($color-error, (10 * 5) ) !default;
134-
$color-action-failure-brd: lighten($color-error, (20 * 5) ) !default;
135-
136116
// Available states
137117
$states: (
138118
active,
@@ -160,11 +140,6 @@ $states: (
160140
void
161141
) !default;
162142

163-
// Available actions
164-
$actions: edit, clone, remove, void, capture, save, cancel, mail, failure !default;
165-
$actions-bg-colors: $color-action-edit-bg, $color-action-clone-bg, $color-action-remove-bg, $color-action-void-bg, $color-action-capture-bg, $color-action-save-bg, $color-action-cancel-bg, $color-action-mail-bg, $color-action-failure-bg !default;
166-
$actions-brd-colors: $color-action-edit-brd, $color-action-clone-brd, $color-action-remove-brd, $color-action-void-brd, $color-action-capture-brd, $color-action-save-brd, $color-action-cancel-brd, $color-action-mail-brd, $color-action-failure-brd !default;
167-
168143
// Sidebar
169144
//--------------------------------------------------------------
170145
$width-sidebar: 200px !default;

backend/app/views/spree/admin/style_guide/topics/typography/_colors.html.erb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,17 @@ colors = [
3939
used_for: 'Buttons primary actions, links, active states.'
4040
},
4141
{
42-
name: '$color-success',
42+
name: 'theme-color(success)',
4343
value: '#52B73B',
4444
used_for: 'Success actions.'
4545
},
4646
{
47-
name: '$color-error',
47+
name: 'theme-color(danger)',
4848
value: '#CE452A',
4949
used_for: 'Errors, destructive action warnings.'
5050
},
5151
{
52-
name: '$color-notice',
52+
name: 'theme-color(warning)',
5353
value: '#FFDD59',
5454
used_for: 'Warnings actions.'
5555
}

0 commit comments

Comments
 (0)