Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 841679
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T05:50:15+00:00 2026-05-15T05:50:15+00:00

If using HAML on Ruby on Rails, then :sass #someDiv border: 3px dashed orange

  • 0

If using HAML on Ruby on Rails, then

:sass
  #someDiv
    border: 3px dashed orange

won’t have any <style> tag around them.

and then

:css
  :sass
    #someDiv
      border: 3px dashed orange

won’t kick on the :sass filter, but

:css
:sass
  #someDiv
    border: 3px dashed orange

will kick on the :sass filter, but it is outside of the <style> tag. So how can the :sass filter be used? We can manually wrap <style> around it, but it is not common use that we want to generate css from sass but not inside <style> tag in an HAML file.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T05:50:16+00:00Added an answer on May 15, 2026 at 5:50 am

    The documentation related to your question is here at haml-lang.com and a more detailed explanation over at sass-lang.com.

    I believe what you are missing is that sass should not be used in your haml files. They should be placed in public/stylesheets/sass with a .sass extension. They will be compiled into a .css file in public/stylesheets, which you then link into your layout.

    From the sas-lang.com link:

    For instance, public/stylesheets/sass/main.scss would be compiled to public/stylesheets/main.css.

    You would then use the stylesheet_link_tag helper (or link the stylesheet manually):

    <%= style_sheet_link_tag 'main' %>
    

    If you really need to use sass within haml, here is the answer. You can not nest filters in haml. You apparently need to do something like this:

    %style(type="text/css") 
      :sass 
        div 
          color: red 
    

    I believe this was the original response from the haml google groups.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.