Font color changes on the first page but not on other pages.

Everything to do with Joomla! 4.x templates and templating.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10.
Post Reply
dagobertdac
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Thu Jun 08, 2023 1:28 pm

Font color changes on the first page but not on other pages.

Post by dagobertdac » Thu Jun 08, 2023 1:50 pm

I'm quiet a beginner, still i made a user.css. Was happy the color of the font changed, to my surprise only on the homepage not on the other pages. What did i do wrong.
Site:probeerenswat.nl
You do not have the required permissions to view the files attached to this post.

User avatar
cmbay
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 238
Joined: Thu Dec 31, 2009 11:53 pm
Location: Oregon, USA

Re: Font color changes on the first page but not on other pages.

Post by cmbay » Thu Jun 08, 2023 4:06 pm

dagobertdac wrote:
Thu Jun 08, 2023 1:50 pm
Was happy the color of the font changed, to my surprise only on the homepage not on the other pages. What did i do wrong.
Which color should the text be?
#07679A or rgb(61,134,172);

Did you intend to put two underscores in the .com-content-article__body selector?
Site:probeerenswat.nl
Returns Server Not Found.
Charles

Mr. Wimpy
Joomla! Explorer
Joomla! Explorer
Posts: 429
Joined: Fri Dec 02, 2005 10:46 am
Location: The Netherlands

Re: Font color changes on the first page but not on other pages.

Post by Mr. Wimpy » Thu Jun 08, 2023 5:23 pm

The correct URL is

Code: Select all

http://probeereenswat.nl
Not sure why, on other pages, user.css is loaded, but not used...

Anyway, you have incorrect CSS.
It seems you used custom properties as regular properties.

Use either custom properties:

Code: Select all

:root { /* NOTE: not body */
  --body-bg: rgb(229,229,229);
  --body-color: rgb(61,134,172);
  --body-font-size: 1.1rem;
  --body-font-weight: 400;
  --body-line-height: 1.5;
  --body-font-color: hsl(201, 47%, 46%);
}
or with regular properties:

Code: Select all

body {
  background: rgb(229,229,229);
  color: rgb(61,134,172);
  font-size: 1.1rem;
  font-weight: 400;
  line-height: 1.5;
}

User avatar
cmbay
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 238
Joined: Thu Dec 31, 2009 11:53 pm
Location: Oregon, USA

Re: Font color changes on the first page but not on other pages.

Post by cmbay » Thu Jun 08, 2023 5:40 pm

Mr. Wimpy wrote:
Thu Jun 08, 2023 5:23 pm
Anyway, you have incorrect CSS.
Yes and a CSS validator shows for the user.css file:
21 body Parse Error color: rgb(61,134,172)
22 body Property body-font-size doesn't exist : 1.1rem
23 body Property body-font-weight doesn't exist : 400
24 body Property body-line-height doesn't exist : 1.5
25 body Property body-font-color doesn't exist : hsl(201 47% 46%)
Charles

dagobertdac
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Thu Jun 08, 2023 1:28 pm

Re: Font color changes on the first page but not on other pages.

Post by dagobertdac » Thu Jun 08, 2023 6:04 pm

Thanks A lot, #Wimpy I used the regular properties. That works, but also remembered i made a child template and didn't make it default. Maybe thatmade a difference too Everything looks oké now. So how is the topic closed? Thx a lot

User avatar
cmbay
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 238
Joined: Thu Dec 31, 2009 11:53 pm
Location: Oregon, USA

Re: Font color changes on the first page but not on other pages.

Post by cmbay » Thu Jun 08, 2023 7:07 pm

Be sure to fix the remaining error at line 25 in user.css:

.h1, .h2, .h3, .h4, .h5, .h6 Parse Error root { /* NOTE: not body */ --body-bg: rgb(229,229,229); --body-color: rgb(61,134,172); --body-font-size: 1.1rem; --body-font-weight: 400; --body-line-height: 1.5; --body-font-color: hsl(201, 47%, 46%); }

Also, you don't need to close this thread.
Charles

sozzled
I've been banned!
Posts: 13639
Joined: Sun Jul 05, 2009 3:30 am
Location: Canberra, Australia

If you have solved your problem …

Post by sozzled » Fri Jun 09, 2023 7:20 am

dagobertdac wrote:
Thu Jun 08, 2023 6:04 pm
So how is the topic closed?
If you have resolved your problem, please mark your topic as solved (see viewtopic.php?f=7&t=996949 for instructions how to do that). 8)

Mr. Wimpy
Joomla! Explorer
Joomla! Explorer
Posts: 429
Joined: Fri Dec 02, 2005 10:46 am
Location: The Netherlands

Re: Font color changes on the first page but not on other pages.

Post by Mr. Wimpy » Fri Jun 09, 2023 9:18 am

cmbay wrote:
Thu Jun 08, 2023 7:07 pm
Be sure to fix the remaining error at line 25 in user.css:

.h1, .h2, .h3, .h4, .h5, .h6 Parse Error (...)
Correct. It is missing the closing }.

Also follow the correct order.
CSS is read from top to bottom and bottom lines override top lines in the file. (Generally speaking)

So :root {...} goes at the top.
BTW: These are custom properties and you can remover the note ;)

As an example you can open Cassiopeia's template CSS file:
It's in ~/media/templates/site/cassiopeia/css/template.css


Post Reply

Return to “Templates for Joomla! 4.x”