While running CSSLint on vartheme or vartheme subtheme we will get errors.

csslint --errors=box-model,display-property-grouping,duplicate-background-images,duplicate-properties,errors,empty-rules,import,important,known-properties,outline-none,overqualified-elements,qualified-headings,shorthand,star-property-hack,text-indent,underscore-property-hack,unique-headings,unqualified-attributes,vendor-prefix,zero-units --warnings="*" path_to_file

Comments

yasmeensalah created an issue. See original summary.

yasmeensalah’s picture

StatusFileSize
new4.81 KB

Fixing css/theme/footer.theme.css and css/theme/betterlogin.theme.css for both vartheme and varthemesubtheme

rajab natshah’s picture

Title: Fix CSSLint errors » Fix CSSLint errors on generated Vartheme BS4 Sub-theme

Thank you Yasmeen for reporting!

The right parameter set for CSSLint are in the following Drupal core Style lint file
https://git.drupalcode.org/project/drupal/-/blob/8.8.x/core/.stylelintrc...

We could manage ignoreFiles or unit-whitelist by adding the file .stylelintrc.json in our themes or modules

.eslintignore
https://git.drupalcode.org/project/drupal/-/blob/8.8.x/core/.eslintignore
.eslintrc.json
https://git.drupalcode.org/project/drupal/-/blob/8.8.x/core/.eslintrc.json

Having the fixes, and we may add the list of .stylelintrc.json, .eslintignore, .eslintrc.json to run the small command only by passing the list of files into the csslint command

rajab natshah’s picture

.title is too generic class it will affect the website

-  h2.title {
+  .title {
     margin: 0;
     padding: 0 0 15px;
     font-size: 2em;
@@ -28,7 +26,7 @@
     background: $body-bg;
     padding: 15px;
     overflow: hidden;
-    box-shadow: 0 0 3px 1px $box-shadow;
+    box-shadow: $box-shadow;
   }
rajab natshah’s picture

Please make sure that you are using the latest Bootstrap 4.5.0 when you try to compile SASS.

As we had #3137834: Update [Bootstrap 4] library from 4.4.1 to 4.5.0

rm node_modules
npm install
gulp

More info in the issue

rajab natshah’s picture

After
#3143759: Add Default CSSLint, ESLint, Stylelint , and Yarn files in Vartheme BS4 and Vartheme Sub-theme

We could run the csslint, stylelint, eslint as in
https://git.drupalcode.org/project/vartheme_bs4/-/blob/8.x-6.x/package.j...

rajab@vardot-dev:/var/www/html/products/vartheme_bs4$ csslint /var/www/html/products/vartheme_bs4

We may use the following too

rajab@vardot-dev:/var/www/html/products/vartheme_bs4$ yarn run lint:css
rajab@vardot-dev:/var/www/html/products/vartheme_bs4$ yarn run lint:core-js

or our development for the VARTHEME_BS4_SUBTHEME

rajab@vardot-dev:/var/www/html/products/vartheme_bs4/VARTHEME_BS4_SUBTHEME$ yarn run lint:css
rajab@vardot-dev:/var/www/html/products/vartheme_bs4/VARTHEME_BS4_SUBTHEME$ yarn run lint:core-js

In custom projects with custom themes

rajab@vardot-dev:/var/www/html/projects/themes/custom/MY_CUSTOM_THEME$ yarn run lint:css
rajab@vardot-dev:/var/www/html/projects/themes/custom/MY_CUSTOM_THEME$ yarn run lint:core-js

We could make use of yarn run lint:css --fix

rajab natshah’s picture

The out come CSS for the title class is valid

 #auth-box .title {
  margin: 0;
  padding: 0 0 15px;
  font-size: 2em;
}

It is right on SACSS

#auth-box {
  padding: $navbar-brand-height 0 0;

  #the-logo {
    text-align: center;
    margin: 0;
    padding: 0 0 25px;
  }

  .title {
    margin: 0;
    padding: 0 0 15px;
    font-size: 2em;
  }

  #middle-part {
    border-radius: 3px;
    background: $body-bg;
    padding: 15px;
    overflow: hidden;
    box-shadow: $box-shadow;
  }

rajab natshah’s picture

Assigned: Unassigned » mohammed j. razem
Category: Feature request » Bug report
Status: Active » Needs review
Issue tags: +varbase-8.8.5

Committed Yasneen's patch as is
The logic is right in SASS and the CSS will work well
Thank you

rajab natshah’s picture

Assigned: mohammed j. razem » Unassigned
rajab natshah’s picture

Status: Needs review » Fixed
rajab natshah’s picture

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.