Skip to content

Commit

Permalink
feat(storefront): BCTHEME-152 Replaced scss-lint with stylelint (#2069)
Browse files Browse the repository at this point in the history
  • Loading branch information
BC-tymurbiedukhin authored Jul 19, 2021
1 parent c720c86 commit 8e45901
Show file tree
Hide file tree
Showing 78 changed files with 3,108 additions and 1,567 deletions.
20 changes: 3 additions & 17 deletions .github/workflows/pull_request_review.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This workflow will do a clean install of your theme's dependencies and attempt to bundle the theme with Stencil CLI.
# This workflow will do a clean install of your theme's dependencies and attempt to bundle the theme with Stencil CLI.
# If the theme fails to bundle, you can review the error logs to find out why.
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

Expand All @@ -23,20 +23,6 @@ jobs:
- name: Checkout code
uses: actions/checkout@v2

- name: Ruby Gem cache
uses: actions/cache@v2.1.3
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gems-
- name: Setup Ruby 2.7
uses: ruby/setup-ruby@v1.51.1
with:
ruby-version: 2.7
- run: bundle install

- name: Use Node.js ${{ matrix.node }}
uses: actions/setup-node@v2-beta
with:
Expand All @@ -56,7 +42,7 @@ jobs:
- name: Install Theme Dependencies
run: npm ci

- name: Grunt Check
- name: Grunt Check
run: npx grunt check

- name: Validate theme successfully bundles
Expand All @@ -67,7 +53,7 @@ jobs:
with:
name: Bundled Theme
path: bundle.zip

- name: Upload bundle analysis
uses: actions/upload-artifact@v2
with:
Expand Down
60 changes: 0 additions & 60 deletions .scss-lint.yml

This file was deleted.

23 changes: 23 additions & 0 deletions .stylelintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"extends": "stylelint-config-sass-guidelines",
"plugins": [
"stylelint-scss"
],
"rules": {
"color-named": null,
"indentation": 4,
"max-nesting-depth": null,
"property-no-vendor-prefix": null,
"selector-no-vendor-prefix": null,
"scss/at-mixin-pattern": null,
"scss/dollar-variable-colon-space-after": null,
"scss/dollar-variable-pattern": null,
"scss/percent-placeholder-pattern": null,
"selector-class-pattern": null,
"selector-max-compound-selectors": null,
"selector-max-id": null,
"selector-no-qualifying-type": null,
"string-quotes": "double",
"value-no-vendor-prefix": null
}
}
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## Draft
- Scss lint has been replaced with stylelint. [#2069](https://github.com/bigcommerce/cornerstone/pull/2069)

## 5.7.1 (2021-07-09)
- Update lang files for some locales. [#2086](https://github.com/bigcommerce/cornerstone/pull/2086)


## 5.7.0 (2021-07-01)
- Implement CEV language files into Cornerstone. [#2084](https://github.com/bigcommerce/cornerstone/pull/2084)
- Added translations for Consent Manager. [#2083](https://github.com/bigcommerce/cornerstone/pull/2083)
Expand Down
3 changes: 0 additions & 3 deletions Gemfile

This file was deleted.

17 changes: 0 additions & 17 deletions Gemfile.lock

This file was deleted.

13 changes: 4 additions & 9 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
module.exports = function(grunt) {
module.exports = function (grunt) {
require('time-grunt')(grunt);
require('load-grunt-config')(grunt, {
jitGrunt: {
staticMappings: {
scsslint: 'grunt-scss-lint'
}
}
});
require('load-grunt-config')(grunt);

grunt.loadNpmTasks('grunt-run');
grunt.registerTask('default', ['eslint', 'jest', 'scsslint', 'svgstore'])
grunt.loadNpmTasks('grunt-stylelint');
grunt.registerTask('default', ['eslint', 'svgstore']);
};
8 changes: 4 additions & 4 deletions assets/scss/common/_aria.scss
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
.aria-description {
&--hidden {
height: 1px;
left: 0;
margin-left: -10000px;
overflow: hidden;
position: absolute;
top: 0;
left: 0;
height: 1px;
width: 1px;
overflow: hidden;
margin-left: -10000px;
}
}
62 changes: 31 additions & 31 deletions assets/scss/common/_focus-tooltip.scss
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
@mixin addFocusTooltip ($attr: title) {
&:before {
content: " ";
position: absolute;
right: 0;
top: 50%;
border-width: remCalc(10px);
border-style: solid;
border-color: transparent transparent $focusTooltip-backgroundColor transparent;
}
&::before {
border-color: transparent transparent $focusTooltip-backgroundColor transparent;
border-style: solid;
border-width: remCalc(10px);
content: " ";
position: absolute;
right: 0;
top: 50%;
}

&:after {
content: attr($attr);
padding: remCalc(4px) remCalc(6px);
background-color: $focusTooltip-backgroundColor;
color: $focusTooltip-textColor;
position: absolute;
font-size: 1rem;
white-space: nowrap;
right: 0;
top: 100%;
cursor: default;
border-radius: remCalc(8px);
}
&::after {
background-color: $focusTooltip-backgroundColor;
border-radius: remCalc(8px);
color: $focusTooltip-textColor;
content: attr($attr);
cursor: default;
font-size: 1rem;
padding: remCalc(4px) remCalc(6px);
position: absolute;
right: 0;
top: 100%;
white-space: nowrap;
}

&:before,
&:after {
display: none;
}
&::before,
&::after {
display: none;
}

&:focus {
&:before,
&:after {
display: block;
}
&:focus {
&::before,
&::after {
display: block;
}
}
}
4 changes: 2 additions & 2 deletions assets/scss/common/index.scss
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
@import 'aria';
@import 'focus-tooltip';
@import "aria";
@import "focus-tooltip";
3 changes: 0 additions & 3 deletions assets/scss/components/citadel/actionBar/_actionBar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,14 @@


.actionBar-section {

.form-field {
background-color: $input-bg-color;
border: $actionBar-form-field-border;
border-radius: $actionBar-form-field-radius;

// scss-lint:disable NestingDepth
&:hover {
border-color: stencilColor("input-border-color-active");
}
// scss-lint:enable NestingDepth
}

.form-label {
Expand Down
22 changes: 9 additions & 13 deletions assets/scss/components/citadel/cards/_cards.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,16 @@
.card-figcaption {
opacity: 1;
}
}
}
}

.card-figure {
margin-top: $card-figure-marginTop;
position: relative;
padding: 3px;
overflow: hidden;
padding: 3px;
position: relative;

&:hover {

// scss-lint:disable NestingDepth
.card-figcaption {
opacity: 1;
}
Expand All @@ -46,9 +44,9 @@
}

.card-img-container {
max-width: get-width(stencilString('productgallery_size'));

@include lazy-loaded-padding('productgallery_size');
@include lazy-loaded-padding("productgallery_size");
max-width: get-width(stencilString("productgallery_size"));
}

.card-figcaption {
Expand All @@ -70,11 +68,11 @@
.card-image {
@include lazy-loaded-img;
border: 0;
width: 100%;
/* Object-fit polyfill */
font-family: "object-fit: contain;";
max-height: 100%;
object-fit: contain;
/* Object-fit polyfill */
font-family: 'object-fit: contain;';
width: 100%;
}

.card-title {
Expand All @@ -83,10 +81,9 @@

> a {
color: $card-title-color;
text-decoration: $card-title-textDecoration;
display: block;
text-decoration: $card-title-textDecoration;

// scss-lint:disable NestingDepth
&:hover {
color: $card-title-color-hover;
}
Expand Down Expand Up @@ -157,7 +154,6 @@
&:hover {
border-color: stencilColor("color-primary");

// scss-lint:disable SelectorDepth, NestingDepth
.card-body {
background-color: stencilColor("color-primary");

Expand Down
Loading

0 comments on commit 8e45901

Please sign in to comment.