Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

evaluate write CSS with myth preprocessor #33

Open
gasolin opened this issue Apr 11, 2014 · 3 comments
Open

evaluate write CSS with myth preprocessor #33

gasolin opened this issue Apr 11, 2014 · 3 comments

Comments

@gasolin
Copy link
Contributor

gasolin commented Apr 11, 2014

myth is a CSS pre-processor act like CSS polyfill
https://github.com/segmentio/myth

Looks more fit for our concerns.

Myth lets you write pure CSS while still giving you the benefits of tools like LESS and Sass. You can still use variables and math functions

benifits:

  • real css, so no interpreter needed in development phase
  • can remove browser-specific prefix, which could be generated by pre-processor.
  • css variable will be pre-processed for production code, less performance impact

need to do:

@gasolin gasolin changed the title evaluate myth preprocessor evaluate write CSS with myth preprocessor Apr 11, 2014
@basiclines
Copy link
Contributor

Hey @gasolin nice to see you agian too!
I'm not longer involved in the Building Blocks development, and as far as i know @rnowm is taking care of it.

Anyway i've been testing myth.io couple of months ago and i was quite satisfied but i think that being able to target specific-browser prefix is not availiable right now. (in fact one of the comments on the issue that you linked is mine :D)

But, myth.io is based on rework which have differents built-in separated modules. This means that you can use myth.io var- like syntax without needed to have the prefixes output, just the features that you want to use.

I made a rudimentary script to test this out some time ago, as rework is kind of more manually work with nodeJS than myth.io wich is just running a CLI:

// Dependencies
var fs = require('fs');
var rework = require('rework');
var vars = require('rework-vars')();

// Global config
var src_path = "src/";
var dist_path = "";
var dist_name = "distributionfile.css";

// Files arrangement
var css = "";
var files = [
    'module-a.css',
    'module-b.css',
    'module-c.css',
];

// Get CSS files
files.forEach(function(key) {
    css += fs.readFileSync(src_path+key, 'utf8');
});

// Rework them only with rework-vars
var converted = rework(css)
    .use(vars)
    .toString();

// Output CSS
fs.writeFileSync(dist_path+dist_name, converted);

Hope it helps you guys on taking a step forward in the Building Blocks development :D

@gasolin
Copy link
Contributor Author

gasolin commented Apr 13, 2014

Thanks @basiclines for feedback. I'd like to have the auto-prefixing integration, so we could generate gaia and cross platform version with a single future-proved code base.

@gasolin
Copy link
Contributor Author

gasolin commented Apr 15, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants