xoops forums


Home away from home
Posted on: 2011/1/2 5:29
redheadedrod (Show more)
Home away from home
Posts: 1296
Since: 2008/2/26

How many .css sheets are used with xoops and where are they?

Ok, I am curious how the .css structure of xoops is designed?

There is a xoops.css

and most themes at minimum have a style.css.

Been told we can put a style.css in with the module as well.

I am curious how this works and how it all ties together?

How do these all get used?

Is the xoops.css read first then the theme style.css then the module style.css? Then by inheritance they would be read in that order so module style.css would override theme.css which would override xoops.css?




Not too shy to talk
Posted on: 2011/1/2 13:54
Tarik (Show more)
Not too shy to talk
Posts: 170
Since: 2010/2/3 1

Re: How many .css sheets are used with xoops and where are they?

if you open the source code of a website using xoops by using the browser you will see something like this

<!-- Sheet Css -->
link rel="stylesheet" type="text/css" media="all" title="Style sheet" href="http://www.arabxoops.com/xoops.css" />
link rel="stylesheet" type="text/css" media="all" title="Style sheet" href="http://www.arabxoops.com/themes/2010/css/style.css" />
customized header contents -->

the 2 first stylesheet are both called from the file theme.html
so that xoops.css will be the first stylesheet to load containing some css resets concerning some xoops elements (banner,blocks,....)

after that style.css contain the enhancement part (styling with images ..) and because it's after xoops.css it can override some css rules if you change them in style.css

after that come the tough part
<!-- customized header contents -->

here xoops put all css stylesheets called by php or the ones that change depending on some parameters
- like modules, some modules requires some css styling so they can add style sheet just by adding in the php side
$xoTheme->addStylesheet(XOOPS_URL '/modules/yourmodule/style.css');

- like language some langage use right align and rtl so xoops add a style sheet arabic.css or english.css that have a big reset with a lot of !important

that is the big idea behind the magic of xoops css
I hope that you caught the idea


Just popping in
Posted on: 2012/5/25 9:28
TenLong (Show more)
Just popping in
Posts: 14
Since: 2012/5/3 1

Re: How many .css sheets are used with xoops and where are they?

The strange thing is that even though some modules include additional css files, they do not appear in the final webpage if the theme is change. I currently have the problem with wfdownloads.

Can you tell me in which php script the css files added by $xoThemes->addStylesheet(...) are included to the html file in the section
"customized header contents"?

And why is this include successfull for the "default" theme, but fails for others?