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
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | css-lint-errors-fix-3142973-2.patch | 4.81 KB | yasmeensalah |
Comments
Comment #2
yasmeensalah commentedFixing css/theme/footer.theme.css and css/theme/betterlogin.theme.css for both vartheme and varthemesubtheme
Comment #3
rajab natshahThank 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
Comment #4
rajab natshah#3143759: Add Default CSSLint, ESLint, Stylelint , and Yarn files in Vartheme BS4 and Vartheme Sub-theme
Comment #5
rajab natshah.title is too generic class it will affect the website
Comment #6
rajab natshahPlease 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
More info in the issue
Comment #7
rajab natshahAfter
#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...
We may use the following too
or our development for the VARTHEME_BS4_SUBTHEME
In custom projects with custom themes
We could make use of
yarn run lint:css --fixComment #8
rajab natshahThe out come CSS for the title class is valid
It is right on SACSS
Comment #10
rajab natshahCommitted Yasneen's patch as is
The logic is right in SASS and the CSS will work well
Thank you
Comment #11
rajab natshahComment #12
rajab natshahComment #13
rajab natshahFor sure we will have one more optimization round with
yarn lint:cssandyarn lint:core-jsas we did #3143759: Add Default CSSLint, ESLint, Stylelint , and Yarn files in Vartheme BS4 and Vartheme Sub-theme
and Change records stylelint replacing csslint in core
#2866840: Use stylelint as opposed to csslint in DrupalCI