Adding custom CSS

View: New views
6 Messages — Rating Filter:   Alert me  

Adding custom CSS

by doahh :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I am trying to customise the CSS in CAS but would prefer not to use cas.css as I have my CSS split across several files. I have tried to include the CSS into the template in several different ways but none seem to work the way I would like.

1) <link rel="stylesheet" href="http://localhost:8080/tootired.net/cas/root-context-css/user/column-layout.css" type="text/css" media="screen" /> Works but I would prefer not to have the FQDN;

2) <link rel="stylesheet" href="/root-context-css/user/column-layout.css" type="text/css" media="screen" /> Returns a blank page with no CSS styles defines in it;

3) <link rel="stylesheet" href="<spring:theme code="css" />" type="text/css" media="all" /> Theme 'default': No message found under code 'css' for locale 'en'. Adding an entry into messages.properties does not change the error message and there is no messages_en.properties;

4) <link rel="stylesheet" href="../../../../../root-context-css/user/column-layout.css" type="text/css" media="screen" />  Does nothing;

5) <style type="text/css" media="screen">@import 'css/cas.css'/**/;</style> Doesn't work either;

6) Adding a new option to default_views.properties but it doesn't work doing that alone and I am not sure what else I would need to change to make it work.

What else can I try?

Re: Adding custom CSS

by doahh :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

A bit more experimentation shows that this is a problem with retrieving the CSS over https. I can get them over http but as CAS has to run over https, any request that does not specify the protocol will default to https (I assume), so using relative paths is failing. I can retrieve stylesheets in other contexts over both http and https so it looks like CAS is doing something with https requests.

Re: Adding custom CSS

by scott_battaglia :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On Thu, Jul 3, 2008 at 5:55 AM, doahh <gavin@...> wrote:

I am trying to customise the CSS in CAS but would prefer not to use cas.css
as I have my CSS split across several files. I have tried to include the CSS
into the template in several different ways but none seem to work the way I
would like.

1) <link rel="stylesheet"
href="http://localhost:8080/tootired.net/cas/root-context-css/user/column-layout.css"
type="text/css" media="screen" /> Works but I would prefer not to have the
FQDN;

2) <link rel="stylesheet" href="/root-context-css/user/column-layout.css"
type="text/css" media="screen" /> Returns a blank page with no CSS styles
defines in it;

This doesn't work because you're making a normal HTTP request so what you're actually requesting is http://localhost:8080/root-context-css/user/column-layout.css


3) <link rel="stylesheet" href="<spring:theme code="css" />" type="text/css"
media="all" /> Theme 'default': No message found under code 'css' for locale
'en'. Adding an entry into messages.properties does not change the error
message and there is no messages_en.properties;
You need to define a css attribute in the default.properties file for the theme (though it follows the same restrictions as #2)
 


4) <link rel="stylesheet"
href="../../../../../root-context-css/user/column-layout.css"
type="text/css" media="screen" />  Does nothing;

I would have absolutely no clue what HTTP request is being made for that page.
 


5) <style type="text/css" media="screen">@import 'css/cas.css'/**/;</style>
Doesn't work either;

Isn't this what's there already?


6) Adding a new option to default_views.properties but it doesn't work doing
that alone and I am not sure what else I would need to change to make it
work.

That wouldn't do anything at all.


What else can I try?

The pages are only HTML pages so they follow the same limitations that normal HTML pages have.  So just do what you would do for any other HTML page.
 


--
View this message in context: http://www.nabble.com/Adding-custom-CSS-tp18255852p18255852.html
Sent from the CAS Users mailing list archive at Nabble.com.

_______________________________________________
Yale CAS mailing list
cas@...
http://tp.its.yale.edu/mailman/listinfo/cas


_______________________________________________
Yale CAS mailing list
cas@...
http://tp.its.yale.edu/mailman/listinfo/cas

Re: Adding custom CSS

by scott_battaglia :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

If you've having trouble retrieving over HTTP vs. HTTPS then you have a problem with either your Tomcat or Apache configuration.

-Scott

-Scott Battaglia
PGP Public Key Id: 0x383733AA
LinkedIn: http://www.linkedin.com/in/scottbattaglia

On Thu, Jul 3, 2008 at 7:00 AM, doahh <gavin@...> wrote:

A bit more experimentation shows that this is a problem with retrieving the
CSS over https. I can get them over http but as CAS has to run over https,
any request that does not specify the protocol will default to https (I
assume), so using relative paths is failing. I can retrieve stylesheets in
other contexts over both http and https so it looks like CAS is doing
something with https requests.
--
View this message in context: http://www.nabble.com/Adding-custom-CSS-tp18255852p18256781.html
Sent from the CAS Users mailing list archive at Nabble.com.

_______________________________________________
Yale CAS mailing list
cas@...
http://tp.its.yale.edu/mailman/listinfo/cas


_______________________________________________
Yale CAS mailing list
cas@...
http://tp.its.yale.edu/mailman/listinfo/cas

Solved: Adding custom CSS

by doahh :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Scott and thanks for the reply.

You are right of course, I was simply missing the context path out of example no. 2, when I put it in it works perfectly.

Oddly, even when I use:

href="<%=request.getContextPath() %><spring:theme code="css.column.layout" />"

I still need to add the contextPath, I am surprised that <spring:theme does not handle that for me. I don't know spring so maybe I am missing something simple.

Sorry to have bothered you with a non-CAS problem.

Re: Solved: Adding custom CSS

by scott_battaglia :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Glad to hear it worked!  The Spring Theme stuff doesn't assume anything about the values you're placing on the page.  It could be urls, text, etc. that's why it doesn't resolve anything like that.

-Scott

-Scott Battaglia
PGP Public Key Id: 0x383733AA
LinkedIn: http://www.linkedin.com/in/scottbattaglia

On Thu, Jul 3, 2008 at 10:25 AM, doahh <gavin@...> wrote:

Hi Scott and thanks for the reply.

You are right of course, I was simply missing the context path out of
example no. 2, when I put it in it works perfectly.

Oddly, even when I use:

href="<%=request.getContextPath() %><spring:theme code="css.column.layout"
/>"

I still need to add the contextPath, I am surprised that &lt;spring:theme
does not handle that for me. I don't know spring so maybe I am missing
something simple.

Sorry to have bothered you with a non-CAS problem.
--
View this message in context: http://www.nabble.com/Adding-custom-CSS-tp18255852p18260161.html
Sent from the CAS Users mailing list archive at Nabble.com.

_______________________________________________
Yale CAS mailing list
cas@...
http://tp.its.yale.edu/mailman/listinfo/cas


_______________________________________________
Yale CAS mailing list
cas@...
http://tp.its.yale.edu/mailman/listinfo/cas
LightInTheBox - Buy quality products at wholesale price