Code Monkey home page Code Monkey logo

Comments (12)

robwierzbowski avatar robwierzbowski commented on September 24, 2024

To use extensions you have to tell Codekit to use the system Compass instead of its internal version.

If you install Compass extensions by adding a load/require statement to the beginning of your project's config.rb file, you must switch CodeKit to use an external Compass compiler in order for that extension to work correctly. Do this by installing Compass at the command line as normal (if you're using RVM, make SURE you switch it to the standard system location first!) and then go to the Languages pane of CodeKit's preferences window, select "Compass" and see the "Advanced Compiler Settings" area.

http://incident57.com/codekit/help.php#help-compass

I'm not sure if this is necessary for ad-hoc extensions, so you might want to check out the Bower instructions first. Let me know if this fixes your issue.

from jacket.

tyssen avatar tyssen commented on September 24, 2024

It seems I've gotten around my original problem of not being able to locate jacket by specifying the full path to Jacket in the require statement in config.rb, but now I'm getting:

error style.ios.scss (Line 43 of _jacket.scss: "ios" is not a list for `index')

from jacket.

robwierzbowski avatar robwierzbowski commented on September 24, 2024

Codekit is using an outdated version of Sass. You need to update Sass to at least 3.2.7 where index() was fixed to accept single item lists. You may be able to specify the system's Sass gem instead of Codekit's internal like with Compass above, not really sure as I don't use it.

FYI, to get the path to the system's version of Sass, type which sass on the command line. To update to the latest, type gem update sass, and if they're not installed you can type gem install sass. Same for Compass.

from jacket.

robwierzbowski avatar robwierzbowski commented on September 24, 2024

This article on Css Tricks has instructions on using the system's Sass and Compass, which you can keep updated.

from jacket.

tyssen avatar tyssen commented on September 24, 2024

Thanks, getting closer. Problem I'm having now is that rules that aren't including Jacket are being compiled too, e.g.

.test {
    color: #FFF;
    font-weight: bold
}

.rainy {
    font-size: 1rem;

    @include jacket(ios) {
        background-color: #c0ffee;
        content: 'Double ristretto cortado, stat.';
    }
}

is compiling to

.test {
  color: #FFF;
  font-weight: bold; }

.rainy {
  font-size: 1rem;
  background-color: #c0ffee;
  content: 'Double ristretto cortado, stat.'; }

in ios.css.

from jacket.

robwierzbowski avatar robwierzbowski commented on September 24, 2024

What is your jacket context variable?

from jacket.

tyssen avatar tyssen commented on September 24, 2024

ios.scss contains

$jacket: ios;
@import 'style';

Is that what you meant?

from jacket.

robwierzbowski avatar robwierzbowski commented on September 24, 2024

Yep.

Everything is working the way it should. Jacket lets you set conditional code blocks and then create stylesheets that contain all of your non-conditional styles and whichever of your conditional styles you choose (by setting the $jacket context). Then you serve those separate stylesheets to whatever you made them for (say the full stylesheet to modern browsers and an old ie stylesheet to ie8 and below, or stylesheets tailored to different platforms on an HTML5 app).

Unfortunately there's no way in Sass to print just the code inside a mixin, which sounds like what you were looking for.

from jacket.

tyssen avatar tyssen commented on September 24, 2024

Unfortunately there's no way in Sass to print just the code inside a mixin, which sounds like what you were looking for.

Ah, looks like I've misunderstood how to use it then.

I was hoping to use this with a mobile-first, responsive workflow where I'd have a baseline stylesheet that serves styles for everything and then just include breakpoint-specific code in the other stylesheets and use some detection to concatenate the different files as screen size increased.

At the moment, my master stylesheet is set up like this:

@import "baseline";

// 480px
@media only screen and (min-width: 30em) { @import "480"; }

// 600px
@media only screen and (min-width: 37.5em) { @import "600"; }

but doing it like that means I end up with one big stylesheet served to all devices whereas smaller devices don't need the breakpoint-specific code.

So it's not possible to work with a single SASS file and have it only split out the breakpoint-specific stuff into separate files?

from jacket.

robwierzbowski avatar robwierzbowski commented on September 24, 2024

Yep, not possible right now. You can only have conditional code, not extracted code.

from jacket.

tyssen avatar tyssen commented on September 24, 2024

Bummer. :( Do you have any suggestions for how to achieve the sort of set-up I'm after?

from jacket.

robwierzbowski avatar robwierzbowski commented on September 24, 2024

The current options are to manually write your media queries in blocks and import separately, or write nested media queries and forget about separate media query only stylesheets. I prefer the second.

The Sass issue queue has an issue about breaking media queries out into separate stylesheets IIRC. You might want to watch that issue for the future.

from jacket.

Related Issues (8)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.