Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
Import css inside custom.css
Hello again
Is there a way to import css files in the custom.css?
I know that the existance of custom.css is to help to have the overides organized and clean but its somekind hard to move between open documents and firebug in order to copy paste the things u need to overide.
So i thought why not to import the already named and grouped css the classic theme has and just make the changes on them.
I created a custom.css in _diffs folder with a subfolder in it with the name customCSS and duplicated all the default css files. I imported em in the custom.css file and started to making changes. Although in the html file (from the viewdesigner plugin) I can c all my changes when i deploy the war its like there r is no css at all.
I've checked the links etc. and everything is ok.
I've typed a rule after the imports for test and it worked (I was just changing the color of the body but it did work) but it keeps ignoring the imports.
Does anyone knows if I have to create a particulare structure for the folders?
Do I have to put a specific order in the imports? (I've imported the css file the same way the main.css imports the defaults).
And finally is it possible or I am trying for no reason?
Thanx for any help or suggestion.
P.S. If there is already a same post like mine and I didn't c it pls just point me there and I'll read it.
Is there a way to import css files in the custom.css?
I know that the existance of custom.css is to help to have the overides organized and clean but its somekind hard to move between open documents and firebug in order to copy paste the things u need to overide.
So i thought why not to import the already named and grouped css the classic theme has and just make the changes on them.
I created a custom.css in _diffs folder with a subfolder in it with the name customCSS and duplicated all the default css files. I imported em in the custom.css file and started to making changes. Although in the html file (from the viewdesigner plugin) I can c all my changes when i deploy the war its like there r is no css at all.
I've checked the links etc. and everything is ok.
I've typed a rule after the imports for test and it worked (I was just changing the color of the body but it did work) but it keeps ignoring the imports.
Does anyone knows if I have to create a particulare structure for the folders?
Do I have to put a specific order in the imports? (I've imported the css file the same way the main.css imports the defaults).
And finally is it possible or I am trying for no reason?
Thanx for any help or suggestion.
P.S. If there is already a same post like mine and I didn't c it pls just point me there and I'll read it.
Your import statement should look like:
There was an issue with relative URLs (LPS-1800). What version of Liferay are you running?
@import url(customCSS/file.css);There was an issue with relative URLs (LPS-1800). What version of Liferay are you running?
Thanx for the reply
I am using 5.2.1 and yes the import statement looks the same like the one u wrote.
I am using 5.2.1 and yes the import statement looks the same like the one u wrote.
Using 6.0.1 -
I'm having the same issue. I've put my CSS imports everywhere thinking maybe it was just a IDE issue but no dice. It is showing some very weird results when I deploy my theme also. Just a quick download of what i'm doing... 4 custom color schemes for my theme. Purpose is so that the user can associated each page with a specific color. I have a small bit of override CSS in the following files (just as the documentation for custom color schemes instructs).
@import url(color_schemes/blue.css);
@import url(color_schemes/purple.css);
@import url(color_schemes/orange.css);
@import url(color_schemes/green.css);
When i deploy, I either get default theme only or for some reason one of the color-scheme files (usually green.css) overrides all others.
I have tried putting the imports and actual CSS right into the _diffs/css/custom.css file, right into the css/custom.css file, I made a _diffs/css/main.css file and even put directly into the css/main. Frustrating. Please assist.
I'm having the same issue. I've put my CSS imports everywhere thinking maybe it was just a IDE issue but no dice. It is showing some very weird results when I deploy my theme also. Just a quick download of what i'm doing... 4 custom color schemes for my theme. Purpose is so that the user can associated each page with a specific color. I have a small bit of override CSS in the following files (just as the documentation for custom color schemes instructs).
@import url(color_schemes/blue.css);
@import url(color_schemes/purple.css);
@import url(color_schemes/orange.css);
@import url(color_schemes/green.css);
When i deploy, I either get default theme only or for some reason one of the color-scheme files (usually green.css) overrides all others.
I have tried putting the imports and actual CSS right into the _diffs/css/custom.css file, right into the css/custom.css file, I made a _diffs/css/main.css file and even put directly into the css/main. Frustrating. Please assist.
Have anybody solve the problem?
My CSS imports also just do not work.
The beginning of my `custom.css` file looks following:
@import "compass";
@import url(fonts.css);
@import url(custom_common.css);
@import url(journal-content-article.css);
@import url(color_schemes/green.css);
@import url(color_schemes/orange.css);
Unfortuantely, I see no signs of (for example) `fonts.css` in Chrome Developer tools.
My CSS imports also just do not work.
The beginning of my `custom.css` file looks following:
@import "compass";
@import url(fonts.css);
@import url(custom_common.css);
@import url(journal-content-article.css);
@import url(color_schemes/green.css);
@import url(color_schemes/orange.css);
Unfortuantely, I see no signs of (for example) `fonts.css` in Chrome Developer tools.
Kravchenko Dmitry:
Have anybody solve the problem?
My CSS imports also just do not work.
The beginning of my `custom.css` file looks following:
@import "compass";
@import url(fonts.css);
@import url(custom_common.css);
@import url(journal-content-article.css);
@import url(color_schemes/green.css);
@import url(color_schemes/orange.css);
Unfortuantely, I see no signs of (for example) `fonts.css` in Chrome Developer tools.
Is color_shemes folder within the _diff/css/ folder or at same level? The above *should* work if color_schemes is within css folder along with custom.css
What is "customCSS" in your code? A folder name or what?
Community
Company
Feedback