Skip to content

Commit

Permalink
[CIVIC-1951] Fixed nvm version and SASS declaration. (#409)
Browse files Browse the repository at this point in the history
  • Loading branch information
febdao authored Oct 16, 2024
1 parent d3cd621 commit d679bb5
Show file tree
Hide file tree
Showing 39 changed files with 391 additions and 235 deletions.
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
18.14
3 changes: 2 additions & 1 deletion .stylelintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
"scss/dollar-variable-pattern": ["^(root|_?ct-.+)", {"ignore": "local"}],
"scss/at-function-parentheses-space-before": "never",
"selector-class-pattern": null,
"string-quotes": "single"
"string-quotes": "single",
"no-duplicate-selectors": null
}
}
8 changes: 5 additions & 3 deletions components/00-base/background/background.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
//

@mixin ct-background() {
background-position: center;
background-repeat: no-repeat;
background-size: cover;
& {
background-position: center;
background-repeat: no-repeat;
background-size: cover;
}
}

.ct-background {
Expand Down
6 changes: 4 additions & 2 deletions components/00-base/colors/colors.stories.scss
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@

@include ct-typography('label-extra-small');

text-align: center;
margin: ct-spacing() 0;
& {
text-align: center;
margin: ct-spacing() 0;
}

&::after {
$content: string.to-upper-case(#{$value});
Expand Down
12 changes: 7 additions & 5 deletions components/00-base/layout/layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,13 @@
column-gap: $ct-layout-column-gap;
}

--stl: 1;
--str: 2;
--m: 3;
--sbl: 4;
--sbr: 5;
& {
--stl: 1;
--str: 2;
--m: 3;
--sbl: 4;
--sbr: 5;
}

#{$root}--no-top-left > & {
--stl: 0;
Expand Down
48 changes: 33 additions & 15 deletions components/00-base/mixins/_content.scss
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
h1 {
@include ct-typography('heading-1');

margin-bottom: ct-spacing(3);
& {
margin-bottom: ct-spacing(3);
}

@include ct-breakpoint(m) {
margin-bottom: ct-spacing(4);
Expand All @@ -28,7 +30,9 @@
h2 {
@include ct-typography('heading-2');

margin-bottom: ct-spacing(3);
& {
margin-bottom: ct-spacing(3);
}

@include ct-breakpoint(m) {
margin-bottom: ct-spacing(4);
Expand All @@ -38,7 +42,9 @@
h3 {
@include ct-typography('heading-3');

margin-bottom: ct-spacing(2);
& {
margin-bottom: ct-spacing(2);
}

@include ct-breakpoint(m) {
margin-bottom: ct-spacing(3);
Expand All @@ -48,7 +54,9 @@
h4 {
@include ct-typography('heading-4');

margin-bottom: ct-spacing(2);
& {
margin-bottom: ct-spacing(2);
}

@include ct-breakpoint(m) {
margin-bottom: ct-spacing(3);
Expand All @@ -58,7 +66,9 @@
h5 {
@include ct-typography('heading-5');

margin-bottom: ct-spacing();
& {
margin-bottom: ct-spacing();
}

@include ct-breakpoint(m) {
margin-bottom: ct-spacing(2);
Expand All @@ -68,7 +78,9 @@
h6 {
@include ct-typography('heading-6');

margin-bottom: ct-spacing();
& {
margin-bottom: ct-spacing();
}

@include ct-breakpoint(m) {
margin-bottom: ct-spacing(2);
Expand Down Expand Up @@ -99,12 +111,14 @@
blockquote {
@include ct-typography('quote');

position: relative;
margin: 0;
margin-top: $ct-basic-content-vertical-spacing;
margin-bottom: $ct-basic-content-vertical-spacing;
padding: ct-spacing(2) ct-spacing(3);
display: grid;
& {
position: relative;
margin: 0;
margin-top: $ct-basic-content-vertical-spacing;
margin-bottom: $ct-basic-content-vertical-spacing;
padding: ct-spacing(2) ct-spacing(3);
display: grid;
}

&::before {
content: '';
Expand All @@ -120,14 +134,18 @@
p {
@include ct-typography('quote');

margin-bottom: 0;
& {
margin-bottom: 0;
}
}

cite {
@include ct-typography('label-extra-small');

padding-top: ct-spacing(2);
font-style: normal;
& {
padding-top: ct-spacing(2);
font-style: normal;
}

&::before {
content: '-';
Expand Down
4 changes: 3 additions & 1 deletion components/00-base/mixins/_elevation.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@
$box-shadow: string.unquote($box-shadow);
}

box-shadow: $box-shadow;
& {
box-shadow: $box-shadow;
}
}

@mixin ct-elevation-interaction() {
Expand Down
12 changes: 9 additions & 3 deletions components/00-base/mixins/_grid.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,18 @@
// Container class should wrap every row.
//
@mixin ct-container($contained: true) {
margin: 0 auto;
& {
margin: 0 auto;
}

@if $contained {
// Support super-narrow screens as well.
$_width: map.get($ct-grid-offsets, xs) * 2;

// Use vw instead of % so it calculates on viewport and not parent container.
max-width: calc(100vw - #{$_width});
& {
max-width: calc(100vw - #{$_width});
}

// Set width for container at each breakpoint accounting for offsets at this
// breakpoint.
Expand All @@ -34,7 +38,9 @@
}
}
@else {
width: 100%;
& {
width: 100%;
}

// Reset negative row margins which are used to offset column margins.
> .row {
Expand Down
8 changes: 6 additions & 2 deletions components/00-base/mixins/_highlight.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
// Add highlight stripe to an element.
//
@mixin ct-highlight-stripe-vertical($width, $border-radius: 0, $border-width: ct-particle(0.125), $position: 'left') {
position: relative;
& {
position: relative;
}

&::before {
content: '';
Expand Down Expand Up @@ -35,7 +37,9 @@
// Add highlight stripe to an element.
//
@mixin ct-highlight-stripe-horizontal($height, $border-radius, $border-width: ct-particle(0.125), $position: 'top') {
position: relative;
& {
position: relative;
}

&::before {
content: '';
Expand Down
16 changes: 10 additions & 6 deletions components/00-base/mixins/_link.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
// Set link colors.
//
@mixin ct-link-colors($normal, $hover: $normal, $visited: $normal, $active: $normal, $focus: false) {
color: $normal;
& {
color: $normal;
}

@if $hover != false {
&:hover,
Expand Down Expand Up @@ -71,11 +73,13 @@
// Add text decoration to a link.
//
@mixin ct-link-decoration($underline: false, $underline-hover: true, $underline-active: true, $underline-focus: true) {
@if $underline {
text-decoration: underline;
}
@else {
text-decoration: none;
& {
@if $underline {
text-decoration: underline;
}
@else {
text-decoration: none;
}
}

&:hover {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,29 @@
@include ct-typography('label-large');
@include ct-container();

border-bottom: solid ct-particle(0.125);
margin-bottom: ct-spacing(2);
margin-top: ct-spacing(4);
& {
border-bottom: solid ct-particle(0.125);
margin-bottom: ct-spacing(2);
margin-top: ct-spacing(4);
}
}

#{$root}__subtitle {
@include ct-typography('label-regular');
@include ct-container();

margin-top: ct-spacing(3);
margin-bottom: ct-spacing(2);
& {
margin-top: ct-spacing(3);
margin-bottom: ct-spacing(2);
}
}

#{$root}__content {
@include ct-container();

margin-bottom: ct-spacing(4);
& {
margin-bottom: ct-spacing(4);
}
}

#{$root}__subcontent {
Expand Down
18 changes: 11 additions & 7 deletions components/00-base/typography/typography.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@
p {
@include ct-typography('text-regular');

margin-top: $ct-basic-content-vertical-spacing;
margin-bottom: $ct-basic-content-vertical-spacing;
& {
margin-top: $ct-basic-content-vertical-spacing;
margin-bottom: $ct-basic-content-vertical-spacing;
}

&:first-child {
margin-top: 0;
Expand All @@ -34,11 +36,13 @@ p {
blockquote {
@include ct-typography('quote');

position: relative;
margin: 0;
margin-top: $ct-basic-content-vertical-spacing;
margin-bottom: $ct-basic-content-vertical-spacing;
padding: ct-spacing(2) ct-spacing(3);
& {
position: relative;
margin: 0;
margin-top: $ct-basic-content-vertical-spacing;
margin-bottom: $ct-basic-content-vertical-spacing;
padding: ct-spacing(2) ct-spacing(3);
}

&::before {
content: '';
Expand Down
30 changes: 21 additions & 9 deletions components/01-atoms/button/button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -221,13 +221,17 @@
@error '"#{$type}" is not one of allowed #{$types}.';
}

display: inline-block;
text-decoration: none;
outline-offset: $ct-button-outline-offset;
outline-width: $ct-button-outline-width;
& {
display: inline-block;
text-decoration: none;
outline-offset: $ct-button-outline-offset;
outline-width: $ct-button-outline-width;
}

@if $ct-animation-enabled {
transition: all $ct-button-animation-duration ease;
& {
transition: all $ct-button-animation-duration ease;
}
}

&:focus-visible,
Expand Down Expand Up @@ -298,23 +302,31 @@
@include ct-typography('label-large');

@if $with-padding {
padding: ct-spacing(2) ct-spacing(6);
& {
padding: ct-spacing(2) ct-spacing(6);
}
}
}
@else if $size == 'regular' {
@include ct-typography('label-regular');

@if $with-padding {
padding: ct-spacing(1.75) ct-spacing(5);
& {
padding: ct-spacing(1.75) ct-spacing(5);
}
}
}
@else if $size == 'small' {
@include ct-typography('label-extra-small');

border-width: math.div($ct-button-border-width, 2);
& {
border-width: math.div($ct-button-border-width, 2);
}

@if $with-padding {
padding: ct-spacing() ct-spacing(4);
& {
padding: ct-spacing() ct-spacing(4);
}
}
}
@else {
Expand Down
Loading

1 comment on commit d679bb5

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.