Feature NPM Resource Changed PR-5.3-dev Pending

User tests: Successful: Unsuccessful:

avatar RickR2H
RickR2H
11 Apr 2024

Overriding the Cassiopeia template CSS can be sometimes difficult because of the long class selectors. Encapsulating the default styling in a layer, resets the specificity making CSS changes via the user.css much more pleasant and easy.

Summary of Changes

Added a layer to the CSS

Testing Instructions

  • After installation install the demo blog content
  • Create a user.css in: media/templates/site/cassiopeia/css/user.css
  • Add the code below.
nav span,
nav a,
nav button {
    color: green;
}
  • Visit the frontend of the site and look at the menu navbar on top of the site.
  • Only the sub menu items in the dropdown are changing color due to specificity issues.
  • Apply the patch and build the CSS
  • Now all links have changed color.
  • An easier wat to test without building the CSS, is to open the template.min.css and encapsulate the code with an @layer property
@layer template {
/* Template CSS code goes here */
}

Actual result BEFORE applying this Pull Request

Not all links in the navbar are colored green. Only the ones in the dropdown.

before

Expected result AFTER applying this Pull Request

All links are colored green and layer is added to the browser inspector.

after

Link to documentations

Please select:

  • Documentation link for docs.joomla.org:

  • No documentation changes for docs.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

avatar RickR2H RickR2H - open - 11 Apr 2024
avatar RickR2H RickR2H - change - 11 Apr 2024
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 11 Apr 2024
Category Repository NPM Change
avatar RickR2H RickR2H - change - 11 Apr 2024
The description was changed
avatar RickR2H RickR2H - edited - 11 Apr 2024
avatar RickR2H RickR2H - change - 11 Apr 2024
The description was changed
avatar RickR2H RickR2H - edited - 11 Apr 2024
avatar richard67
richard67 - comment - 11 Apr 2024

Overriding the Cassiopeia template CSS can be sometimes default

@RickR2H I assume you mean “difficult” and not “default”. Got hit by the spellchecker’s auto correction?

avatar RickR2H RickR2H - change - 11 Apr 2024
The description was changed
avatar RickR2H RickR2H - edited - 11 Apr 2024
avatar dgrammatiko
dgrammatiko - comment - 12 Apr 2024

FWIW @layer was introduced on March 2022 universally on all 3 major engines (gecko/blink/webkit). Although the B/C promise is fulfilled (2 latest versions) this seems too early to adopt (especially for the front end template). 2 years is not that huge timeframe especially for the non tech people to update their OS/browsers.

avatar RickR2H RickR2H - change - 15 Apr 2024
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2024-04-15 13:54:09
Closed_By RickR2H
Labels Added: NPM Resource Changed PR-5.1-dev
avatar RickR2H
RickR2H - comment - 15 Apr 2024

Agreed that it's a bit early. I'll close the PR.

avatar RickR2H RickR2H - close - 15 Apr 2024
avatar dgrammatiko
dgrammatiko - comment - 15 Apr 2024

@RickR2H my comment wasn't supposed to be a show stopper but rather a hint to get some decision from the maintainers. Please reopen the PR and let's ask @laoneo, @LadySolveig and the other maintainers for some decision

avatar RickR2H RickR2H - change - 15 Apr 2024
Status Closed New
Closed_Date 2024-04-15 13:54:09
Closed_By RickR2H
avatar RickR2H RickR2H - change - 15 Apr 2024
Status New Pending
avatar RickR2H RickR2H - reopen - 15 Apr 2024
avatar RickR2H
RickR2H - comment - 15 Apr 2024

@dgrammatiko Thanks for the comment. I opened the PR again. I'll leave it for the other to decide.

avatar HLeithner
HLeithner - comment - 24 Apr 2024

This pull request has been automatically rebased to 5.2-dev.

avatar HLeithner HLeithner - change - 24 Apr 2024
Title
Added CSS layer to template CSS files to lower specificity
[5.2] Added CSS layer to template CSS files to lower specificity
avatar HLeithner HLeithner - edited - 24 Apr 2024
avatar HLeithner
HLeithner - comment - 2 Sep 2024

This pull request has been automatically rebased to 5.3-dev.

avatar HLeithner HLeithner - change - 2 Sep 2024
Title
[5.2] Added CSS layer to template CSS files to lower specificity
[5.3] Added CSS layer to template CSS files to lower specificity
avatar HLeithner HLeithner - edited - 2 Sep 2024
avatar RickR2H RickR2H - change - 16 Sep 2024
Labels Added: Feature PR-5.3-dev
Removed: PR-5.1-dev

Add a Comment

Login with GitHub to post a comment