]> git.koha-community.org Git - koha.git/commit
Bug 31529: [OPAC] Fix errors in SCSS files raised by stylelint
authorOwen Leonard <oleonard@myacpl.org>
Thu, 8 Sep 2022 12:15:35 +0000 (12:15 +0000)
committerTomas Cohen Arazi <tomascohen@theke.io>
Mon, 3 Oct 2022 11:24:06 +0000 (08:24 -0300)
commit6255cef0792128c114de4addc6cb4952063bb4c6
treeb779b21987a0eb97d8ea778086319881a3afa0ed
parent503b22548bb67e0699fb2be26e66dcae550e2ba2
Bug 31529: [OPAC] Fix errors in SCSS files raised by stylelint

This patch corrects errors raised by the new stylelint configuration in
OPAC SCSS files. Many of the fixes were made automatically by using the
"--fix" option:

npx stylelint koha-tmpl/opac-tmpl/bootstrap/css/src/*.scss --fix

Some examples of errors found:

    - Unexpected empty line before $-variable
    - Expected single space after ":"
    - Expected "#fff" to be "#FFF"
    - Expected modern color-function notation
    - Expected single space after "("
    - Expected single space before ")"
    - Expected empty line before comment
    - Expected no more than 1 empty line
    - Expected a trailing semicolon
    - Expected color.adjust($color, $lightness: -$amount) instead of darken($color, $amount)
    - Unexpected leading zero
    - Expected single space after "," in a single-line function
    - Expected double colon pseudo-element notation

Manual fixes include replacing named colors with hex codes, combining
duplicate selectors, removing empty blocks, etc.

Some warnings remain: "Unexpected !important" and "Expected a
placeholder selector (e.g. %placeholder) to be used in @extend" which
both require more than a quick fix, if we should choose to address them.

To test, apply the patch and rebuild the OPAC SCSS:
https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client

Browse around the OPAC to confirm that there are no visible changes to
style.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
koha-tmpl/opac-tmpl/bootstrap/css/src/_common.scss
koha-tmpl/opac-tmpl/bootstrap/css/src/_flatpickr.scss
koha-tmpl/opac-tmpl/bootstrap/css/src/_flatpickr_vars.scss
koha-tmpl/opac-tmpl/bootstrap/css/src/_fonts.scss
koha-tmpl/opac-tmpl/bootstrap/css/src/_responsive.scss
koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss
koha-tmpl/opac-tmpl/bootstrap/css/src/print.scss
koha-tmpl/opac-tmpl/bootstrap/css/src/sco.scss