掲示板

Where to add additional CSS to a hook?

thumbnail
11年前 に Brandt Solovij によって更新されました。

Where to add additional CSS to a hook?

New Member 投稿: 14 参加年月日: 12/03/23 最新の投稿
Hi all and thanks in advance - essentially my issue is this :


A colleague of mine has configured a portlet to allow a business / power use to select a "mode" of a specific portlet (the hook) . He accomplished this by way of the custom-jsp process via the SDK plugins route.

The hook compile and imports into my liferay (6.1 on remote Tomcat 7) dev environment. Within his custom-jsp is a main.css. He initially added some light styling and has turned it over to me to finalize all the branding. We are approaching the styling of the hook by simply extending nested css statements in the main.css file

the file is found : docroot -> custom_jsps -> html-> portlet-> <portlet type> -> css -> main.css

However on build + subsequent redeploy ( which produce no warnings or errors both ) - the styles are not adhering to elements and the style declarations are not found within the referenced "main.css" (s) found via View Source.

An example of the approach would be :


.result {
display: inline-block;
float: none;
width: 100%;
.custom-result {
color: red;
}
}

Markup related would of course be

<div class="result">
<span class="custom-result"> some result </span>
</div>


Are we missing a step or ? Suggestions / advice / slander all welcome emoticon
thumbnail
11年前 に David H Nebinger によって更新されました。

RE: Where to add additional CSS to a hook?

Liferay Legend 投稿: 14919 参加年月日: 06/09/02 最新の投稿
I'm assuming the hook applies to a Liferay OOTB portlet, because you cannot hook an external portlet.

I believe if you look at the ROOT/html/portlet/<portlet type>/css folder, you'll see your css files. However, you won't see any other files/directories in /ROOT/html/portlet/<portlet type>/ directory if it's not a Liferay portlet.
thumbnail
11年前 に Brandt Solovij によって更新されました。

RE: Where to add additional CSS to a hook?

New Member 投稿: 14 参加年月日: 12/03/23 最新の投稿
David H Nebinger:
I'm assuming the hook applies to a Liferay OOTB portlet, because you cannot hook an external portlet.

I believe if you look at the ROOT/html/portlet/<portlet type>/css folder, you'll see your css files. However, you won't see any other files/directories in /ROOT/html/portlet/<portlet type>/ directory if it's not a Liferay portlet.



Thanks David - I did find some success when i tried this, but i was unsure if it was the correct approach. If you're endorsing it, I'm good with it! Thank you! emoticon
thumbnail
11年前 に David H Nebinger によって更新されました。

RE: Where to add additional CSS to a hook?

Liferay Legend 投稿: 14919 参加年月日: 06/09/02 最新の投稿
Brandt Solovij:
Thanks David - I did find some success when i tried this, but i was unsure if it was the correct approach. If you're endorsing it, I'm good with it! Thank you! emoticon


Wait, I didn't think I was endorsing anything...

What I said was, if you are trying to change a Liferay portlet, then this would work. But if you're trying to change your own portlet, this will not work.

Personally, though, I'd recommend using a theme. Applies CSS across the board, whether for an OOTB portlet or your own portlets.
thumbnail
11年前 に Brandt Solovij によって更新されました。

RE: Where to add additional CSS to a hook?

New Member 投稿: 14 参加年月日: 12/03/23 最新の投稿
Ok fair enough - I'll approach it from the theme level

-b
thumbnail
11年前 に Brandt Solovij によって更新されました。

RE: Where to add additional CSS to a hook?

New Member 投稿: 14 参加年月日: 12/03/23 最新の投稿
Yep - custom.css within the theme picked up and propagated the changes immediately. We were hoping to bundle the component CSS modifications with the hook project ( hooked to the OOTB portlet ) but it looks like that won't be the case. Thanks again for the suggestions and discussion!
thumbnail
9年前 に Fernando Fernandez によって更新されました。

RE: Where to add additional CSS to a hook?

Expert 投稿: 396 参加年月日: 07/08/22 最新の投稿
I was also using custom.css to override some base css but I have this requirement to suport IE9.

Unfortunately, IE9 does not seem to interpret the CSS files coming from Liferay in the same order and so I think sometimes changing the original css witha hook is really necessary.