ElkArte Community

Project Support => Support => Topic started by: Jorin on December 22, 2015, 05:16:55 am

Title: CSS question
Post by: Jorin on December 22, 2015, 05:16:55 am
Let's say, I have this code in the CSS file of my theme:

Code: [Select]
.codeheader, .quoteheader {
border: 1px solid #ccc;
border-bottom: none;
background: #fff;
color: #464646;
}

And in my custom CSS file I have this:

Code: [Select]
.codeheader, .quoteheader {
color: #383838;
}

What will happen? Will the default CSS file be used and only the color will change because of my custom CSS file? Or will the values for the border and the background be forgotten because they are not in my custom CSS file?

I think the only way using the custom CSS file will be if the system keeps the old values and only changes the color in this example! If it not works like this, the custom CSS file leads to problems and should not be used! Why?

I have changed a lot of colors of the default theme and use a custom CSS file for this changes. Into my file I copied all codes where I wanted to change the color, with all values of this codes, even if they aren't for the colors. Attached is my custom CSS file for better understanding. Works fine, till the update 1.0.5 came and with it some changes for the CSS file. The package manager altered my default CSS file, but because I am using a custom CSS with lot's of code inside, the changes don't work with my themes. So I don't have the small home button in the breadcrumb for example, even with 1.0.6 I am using now.

So what helps would be a system where the default CSS codes are used and then (!) my custom CSS codes will be read and overwrite the default values. So I could only have color changes in my custom CSS file.
Title: Re: CSS question
Post by: Joshua Dickerson on December 22, 2015, 09:13:28 am
The rules are cascading. In other words, the only thing that will change is the color.
Title: Re: CSS question
Post by: Jorin on December 22, 2015, 01:31:04 pm
Really? Thank goodness, that helps a lot. Now I have to edit my custom css file. Thank you!
Title: Re: CSS question
Post by: Jorin on July 16, 2016, 03:22:24 am
Quote from: Joshua Dickerson – The rules are cascading. In other words, the only thing that will change is the color.

You were right (of course)!  :)  I merged my custom_light.css with index_light.css and deleted all the rows that are the same. And it is working (of course), nearly perfect. I had to save some codes in both files to solve some problems with colors, don't know why. Strange.

Thanks a lot!  :)
Title: Re: CSS question
Post by: JesusGod-Pope666.Info on October 12, 2020, 07:59:09 am
You have the newest file around? :)

Og this is not the Social theme, anyone have a color file custom thing for social?