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

  • SEARCH
  • Home
  • 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 9289195
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T20:07:00+00:00 2026-06-18T20:07:00+00:00

In a Compass config.rb file, you can set the environment to :development or :production

  • 0

In a Compass config.rb file, you can set the environment to :development or :production.

Is it possible to use this setting in Sass conditionals? Here’s what I want to do:

@if (environment === :development) {
    @import 'debug';
}

Solved: I found the answer while drafting my question. Will post anyway since I didn’t find anything definitive that actually explains this.

  • 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-06-18T20:07:01+00:00Added an answer on June 18, 2026 at 8:07 pm

    Thanks in part to this issue in the Compass repository, I found that you can use settings-based conditionals in Sass like this:

    @if compass-env() == 'development' {
        body {
            color: red;
        }
    }
    

    Confirmed this works with Sass 3.2.5 + Compass 0.12.2 + Ruby 1.9.3p194.

    However you can’t do this:

    @if compass-env() == 'development' {
        @import 'debug';
    }
    

    That throws a Syntax Error: “Import directives may not be used within control directives or mixins.

    So the workaround is to @import the file and then wrap its entire contents in the environment conditional.

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

Sidebar

Related Questions

In my Compass project I have a config.rb with the setting environment = :development
I use rake to prepare files for development. But I can't compile my sass
In the Compass/Sass plugin, Susy , you set the number of columns in the
In the Compass screencast at 23:08 Chris Eppstein starts editing a file called config.rb
I am a compass sass beginer. I don't want to upload this folder to
I have compass installed but when I try to watch the SASS file I
A horizontal compass looks something like this if you are facing due East (90
In order to achieve spriting by compass according to the documentation I wrote this:
So we've got a standard Compass CSS project, with the sass and css directories.
I have a Wifi iPad and this compass actually knows the direction of north.

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.