Home Forums Basel support forum CSS properties overridden by shorthands

CSS properties overridden by shorthands

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #226970

    pierredemeudon
    Participant

    Hi There,

    When auditing my website, I received this comment

    When a property is used 2 times within a CSS rule, the second one overrides the first.
    CSS provides some shorthand properties, that can leads to some mistakes. For instance, the “border” property is applied to all borders of an element, avoiding the use of all “border-top”, “border-right”, “border-left” and “border-bottom” properties.

    The use of shorthand properties is risky, because it comes with an implicit override. If the resulting style on your page is the desired one -what is the case for me- you should delete the overridden property (it will also reduce the file size).

    https://polinacouture.com/wp-content/themes/basel/style.css?ver=5.3.0

    .mobile-nav .searchform.search-loading:after: “border-color” resets “border-right-color” property set earlier (line 4181, col 5)
    .mobile-nav .searchform.search-loading:after: “border-color” resets “border-left-color” property set earlier (line 4181, col 5)
    .search-extended form.search-loading:after: “border-color” resets “border-right-color” property set earlier (line 4789, col 3)
    .search-extended form.search-loading:after: “border-color” resets “border-left-color” property set earlier (line 4789, col 3)
    .basel-search-dropdown .[…]arch-inner form.search-loading:after: “border-color” resets “border-right-color” property set earlier (line 5073, col 7)
    .basel-search-dropdown .[…]arch-inner form.search-loading:after: “border-color” resets “border-left-color” property set earlier (line 5073, col 7)
    .basel-search-full-scree[…]arch-inner form.search-loading:after: “border-color” resets “border-right-color” property set earlier (line 5270, col 5)
    .basel-search-full-scree[…]arch-inner form.search-loading:after: “border-color” resets “border-left-color” property set earlier (line 5270, col 5)
    and 14 other

    Could that be improved?

    Kind regards

    #227151

    Artem Temos
    Keymaster

    Hello,

    These overrides are required for our theme to work. And even if we remove these few lines your website will not be faster.

    Kind Regards

Viewing 2 posts - 1 through 2 (of 2 total)