offthegrass
offthegrass

Reputation: 456

share Stylus variables across Meteor packages

consider the following app structure:

app.html
app.coffee
app.styl ## global styles, e.g. primary = #222
packages/
    FirstPackage/
        package.styl ## package styles, e.g. background: primary
    SecondPackage/
        package.styl
    ThirdPackage/
        package.styl

how can the packages use the styles defined app.styl?

Upvotes: 0

Views: 186

Answers (2)

jgoley
jgoley

Reputation: 54

This is possible with the meteor stylus package:

When adding the file to share in package.js (package name: project:name), mark it as 'importabe' by adding {isImport: true}:

api.addFiles('file.styl', 'client', {isImport: true});

Then import that file into stylus files of other packages:

@import '{project:name}/file.styl'

More info: https://atmospherejs.com/meteor/stylus#cross-packages-imports

Upvotes: 1

juliancwirko
juliancwirko

Reputation: 1282

take a look here: http://s-grid.meteor.com/#stylusconfiguration This is hard with Meteor for now. But you can add more paths to Stylus build plugin. Here you will find how to do this with package which provide stylus build plugin with config .json file for it: http://s-grid.meteor.com/#additionalincludepaths

Upvotes: 0

Related Questions