Re: [nesta] Having trouble getting sass to work with custom templates
- Hersh Bhasin
- 2011-03-20 @ 14:11
I have it working. My scss is called book.scss. In the app.rb of my
custom template, I had to put this:
get '/css/:book.css' do
content_type 'text/css', :charset => 'utf-8'
Also, in the layout.haml I had to put this in the head section
%link(href="/css/book.css" media="screen" rel="stylesheet")
-- then Nesta will automatically pick it up.
--- On Sun, 3/20/11, Derek P. Collins <email@example.com> wrote:
From: Derek P. Collins <firstname.lastname@example.org>
Subject: [nesta] Having trouble getting sass to work with custom templates
Date: Sunday, March 20, 2011, 3:08 AM
I've created custom templates by following the instructions here:
However, I can't seem to get a custom stylesheet to work with my
templates. I created a filed named "screen.scss" in /views, but the only
way I've been able to get this to work is to create a new set of
directories ("/public/css") and then running:
in order to generate the .css file from the .scss file. However, I thought
this was supposed to be done automatically according to the page that I
linked to above:
"Link to your stylesheet from within the layout (CSS files are
automatically created from Sass files when a page is loaded), a
nd are served up from /css/your-stylesheet.css."
Did I misunderstand this or am I doing something wrong?