Skip to content

Commit 05ca98a

Browse files
authored
Merge pull request #138 from jackdomleo7/130_less_generic_sass_variables
2 parents cbd1853 + e3693a8 commit 05ca98a

8 files changed

Lines changed: 27 additions & 26 deletions

File tree

.github/workflows/pipeline.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ jobs:
4646
node-version: '14.x'
4747
- name: Clean install npm dependencies
4848
run: npm ci
49-
- uses: JS-DevTools/npm-publish@v1
49+
- name: Publish to npm
50+
uses: JS-DevTools/npm-publish@v1
5051
with:
5152
token: ${{ secrets.NPM_TOKEN }}
5253
check-version: true

src/errors/_customisation.scss

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
:root {
22
/* Colors */
33

4-
--checka11y-text-error: #{$text-error};
5-
--checka11y-bg-error: #{$bg-error};
6-
--checka11y-border-error: #{$border-error};
4+
--checka11y-text-error: #{$checka11y-text-error};
5+
--checka11y-bg-error: #{$checka11y-bg-error};
6+
--checka11y-border-error: #{$checka11y-border-error};
77
}

src/errors/_variables.scss

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
$text-error: #721c24 !default;
2-
$bg-error: #ffc6c6 !default;
3-
$border-error: #f00 !default;
1+
$checka11y-text-error: #721c24 !default;
2+
$checka11y-bg-error: #ffc6c6 !default;
3+
$checka11y-border-error: #f00 !default;

src/shared/_variables.scss

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
$font-family: verdana, geneva, tahoma, sans-serif !default;
2-
$font-size: 1rem !default;
3-
$font-weight: 700 !default;
1+
$checka11y-font-family: verdana, geneva, tahoma, sans-serif !default;
2+
$checka11y-font-size: 1rem !default;
3+
$checka11y-font-weight: 700 !default;

src/shared/messages/_content.scss

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
@mixin contentMessage($errorType, $code, $message) {
44
display: block;
5-
font-size: $font-size;
6-
font-family: $font-family;
7-
font-weight: $font-weight;
5+
font-size: $checka11y-font-size;
6+
font-family: $checka11y-font-family;
7+
font-weight: $checka11y-font-weight;
88
font-style: initial;
99
padding: var(--checka11y-space-4) var(--checka11y-space-6);
1010
border-radius: 0.75rem;

src/shared/messages/_vector.scss

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,21 +55,21 @@
5555
$height: length($textLines) * 25 + 30; // number of lines * 25 (line height) + 30 (padding top and bottom)
5656

5757
@if $errorType == error {
58-
$border-svg: $border-error; // stylelint-disable-line scss/no-duplicate-dollar-variables
59-
$bg-svg: $bg-error; // stylelint-disable-line scss/no-duplicate-dollar-variables
60-
$text-svg: $text-error; // stylelint-disable-line scss/no-duplicate-dollar-variables
58+
$border-svg: $checka11y-border-error; // stylelint-disable-line scss/no-duplicate-dollar-variables
59+
$bg-svg: $checka11y-bg-error; // stylelint-disable-line scss/no-duplicate-dollar-variables
60+
$text-svg: $checka11y-text-error; // stylelint-disable-line scss/no-duplicate-dollar-variables
6161
border-color: var(--checka11y-border-error);
6262
}
6363
@else if $errorType == warning {
64-
$border-svg: $border-warning; // stylelint-disable-line scss/no-duplicate-dollar-variables
65-
$bg-svg: $bg-warning; // stylelint-disable-line scss/no-duplicate-dollar-variables
66-
$text-svg: $text-warning; // stylelint-disable-line scss/no-duplicate-dollar-variables
64+
$border-svg: $checka11y-border-warning; // stylelint-disable-line scss/no-duplicate-dollar-variables
65+
$bg-svg: $checka11y-bg-warning; // stylelint-disable-line scss/no-duplicate-dollar-variables
66+
$text-svg: $checka11y-text-warning; // stylelint-disable-line scss/no-duplicate-dollar-variables
6767
border-color: var(--checka11y-border-warning);
6868
}
6969
@else {
7070
@error "The $errorType must be either 'error' or 'warning' and the $code must start with either 'E' or 'W' respectively.";
7171
}
72-
background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="#{$width}px" height="#{$height}px" viewBox="0 0 #{$width} #{$height}"><rect class="box" x="4" y="4" width="#{$width - 8}" height="#{$height - 8}" rx="12" ry="12" fill="#{transparentize($bg-svg, 0.000001)}" stroke-width="0.4rem" stroke="#{transparentize($border-svg, 0.000001)}" /><g fill="#{transparentize($text-svg, 0.000001)}" font-size="#{$font-size}" font-weight="#{$font-weight}" font-family="#{$font-family}" font-style="initial" letter-spacing="initial" text-decoration="none" text-transform="initial" text-shadow="none">#{$textLines}</g></svg>');
72+
background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="#{$width}px" height="#{$height}px" viewBox="0 0 #{$width} #{$height}"><rect class="box" x="4" y="4" width="#{$width - 8}" height="#{$height - 8}" rx="12" ry="12" fill="#{transparentize($bg-svg, 0.000001)}" stroke-width="0.4rem" stroke="#{transparentize($border-svg, 0.000001)}" /><g fill="#{transparentize($text-svg, 0.000001)}" font-size="#{$checka11y-font-size}" font-weight="#{$checka11y-font-weight}" font-family="#{$checka11y-font-family}" font-style="initial" letter-spacing="initial" text-decoration="none" text-transform="initial" text-shadow="none">#{$textLines}</g></svg>');
7373
background-position: bottom center;
7474
background-repeat: no-repeat;
7575
min-width: #{$width}px;

src/warnings/_customisation.scss

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
:root {
22
/* Colors */
33

4-
--checka11y-text-warning: #{$text-warning};
5-
--checka11y-bg-warning: #{$bg-warning};
6-
--checka11y-border-warning: #{$border-warning};
4+
--checka11y-text-warning: #{$checka11y-text-warning};
5+
--checka11y-bg-warning: #{$checka11y-bg-warning};
6+
--checka11y-border-warning: #{$checka11y-border-warning};
77
}

src/warnings/_variables.scss

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
$text-warning: #856404 !default;
2-
$bg-warning: #ffffd8 !default;
3-
$border-warning: #ff6 !default;
1+
$checka11y-text-warning: #856404 !default;
2+
$checka11y-bg-warning: #ffffd8 !default;
3+
$checka11y-border-warning: #ff6 !default;

0 commit comments

Comments
 (0)