joomla / joomla-cms

Home of the Joomla! Content Management System
https://www.joomla.org
GNU General Public License v2.0
4.74k stars 3.64k forks source link

Cassiopeia theme with alternative colors bug #43071

Closed pl71 closed 6 months ago

pl71 commented 6 months ago

Not sure if issue 42679 is connected, but noticed that --link-color: #224faa; is hardcoded in Cassiopeia. I've tried "Templates: Edit Style/Advanced/Colour Theme=Alternative", but links are still blue. "\media\templates\site\cassiopeia\css\global\colors_alternative.css" has at row 4 '--link-color: #30638d;', but it stays not used IMHO.

Steps to reproduce the issue

Have a brand new site with a Cassiopeia theme. Switch to the "Alternative" color theme.

Expected result

Links to use color from colors_alternative.css

Actual result

Links are using color from colors_standard.css link_color

System information (as much as possible)

J5.0.3

Additional comments

Same behavior with the child template. EDIT: Tried also totally different colors, but link-color has to be defined in user.css to work.

ReLater commented 6 months ago

SEE ALSO NEXT COMMENT!

colors_alternative.css defines the link color as blue. Other words: #30638d is a kind of blue.

grafik

grafik

ReLater commented 6 months ago

Confirmed!

AH, sorry! Yes you're right. Wrong color.

Solution: I think colors_alternative.css should be loaded AFTER template.css but is loaded first.

grafik

Looks like it's the same in J!5.1 (but I'm tired ;-) )

pl71 commented 6 months ago

colors_alternative should modify template.css in order to reduce css files on demand.

ReLater commented 6 months ago

Off Topic. Open a discussion?

colors_alternative should modify template.css in order to reduce css files on demand.

I compile my CSS files from SASS/Scss. Also in Cassiopeia child templatess. Then things like that (removing redundant CSS code and combining) are "easily" possible.

But I think your expectation is too much that whenever changing a colors scheme template.css, template.min.css, template.min.css.gz are newly generated. From my point of view it would also obfuscate how colors_xyz.css work. It would become obscure science in this core template that should be as minimalistic as possible. From my point of view ;-)

richard67 commented 6 months ago

Closing as having a pull request. Please test #43084 . Thanks in advance.

ReLater commented 6 months ago

I have closed my pr because:

Closing as this has already been fixed in https://github.com/joomla/joomla-cms/pull/42794/files in another way but not ported to Joomla 5 yet.

I don't know how to port that code.

pl71 commented 6 months ago

@ReLater Not quite sure, but these variables should go before template.css template.css is using them, at least --link-color: 3333:

.btn-link {
    --btn-font-weight: 400;
    --btn-color: var(--link-color);
    ....
richard67 commented 6 months ago

I have closed my pr because:

Closing as this has already been fixed in https://github.com/joomla/joomla-cms/pull/42794/files in another way but not ported to Joomla 5 yet.

I don't know how to port that code.

@ReLater See my comment in your closed PR. The fix should have been ported to the 5.1-dev branch.

ReLater commented 6 months ago

Not quite sure, but these variables should go before template.css template.css is using them, at least --link-color:

Nope. Because it's a :root{} rule. See image:

grafik

ReLater commented 6 months ago

@pl71 just FYI. The fix will be in next 5.1 version.