External CSS files

I fell in love with Radiant’s simplicity the other day. Now I am seeing
if I can migrate a couple sites over to Radiant, but I’m not sure how to
create .css files within the system. Did I something dreadfully
obviously, or do I have to upload the css file separately?

I think most people are dumping their css into a snippet and referencing
it
as needed. One benefit of doing this as a snippet is that you can make
use
of radiant tags to dynamically create styles as needed.

-K

Although, the demo site appears to have stuck the css files in public
and
simply references them from the layout.

-K

Ha! spoke too soon, had to change my charset to UTF-8. Thank you much
for the help!

(Reread my original post and I really need to start proofreading.)

Ah ha! so I figured out how they did it in the demo, now if only I
could duplicate it. I changed the slug to styles.css, though it’s still
not working, but I’m partway there!

I have the odd feeling that my problem now has something to do with how
windows deals with line breaks, because my css file now comes out as a
great jumble: http://radtest.enguindesign.com/styles.css

I’m keeping the .css file in the “public” directory, referencing it
from an “header” snippet, and adjusting it as needed inside the layout
file

*** “header” snippet

@import "/stylesheets/style.css";

(The “<r:snippet name=“gmaps” />” tag includes, for example, a snippet
with additional javascript code, which has to be put within the html

tags to handle a google map in the page.)

*** Layout file

[…]
<r:snippet name=“header” />
<r:unless_url matches="/en/where">


#primary .itemtext img {
margin: 0 5px;
padding: 4px;
border: 1px solid #ccc;
max-width: 100%;
}

</r:unless_url>
[…]

Hope this helps.

–M

Bernard Yu wrote:

Ha! spoke too soon, had to change my charset to UTF-8. Thank you much
for the help!

Be sure to create a layout for stylesheets and set it’s content-type to
“text/css”.


John L.
http://wiseheartdesign.com

Kyle H. wrote:

By doing that does it treat the stylesheet as an external resource and not
embed the contents of the stylesheet in the rendered source? Like it
does if
you simply link to an external stylesheet? Just curious.

I’m not quite sure what you mean. I was referring to the content type on
the layout.


John L.
http://wiseheartdesign.com

By doing that does it treat the stylesheet as an external resource and
not
embed the contents of the stylesheet in the rendered source? Like it
does if
you simply link to an external stylesheet? Just curious.

Thanks.

-K

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs