GithubHelp home page GithubHelp logo

Comments (10)

tbaddade avatar tbaddade commented on June 11, 2024

That would be really nice. 👍

Another Workflow

variables.css contains

:root {
    var-accent: #f00;
}

typo.css contains

a {
    color: var(accent)
}

styles.css contains

@import url(normalize.css);
@import url(variables.css);
@import url(typo.css);

from myth.

ianstormtaylor avatar ianstormtaylor commented on June 11, 2024

+1 i think, this sounds like a cool addition. would be nice to support the media queries allowed for imports as well (dunno if sass/less do this automatically)

from myth.

lionel-m avatar lionel-m commented on June 11, 2024

+1

from myth.

JoshMilo avatar JoshMilo commented on June 11, 2024

+1

from myth.

Ben2HellAndBack avatar Ben2HellAndBack commented on June 11, 2024

+1

from myth.

iantearle avatar iantearle commented on June 11, 2024

+1 and could the output.css file be compiled with the @import'ed files inline - much like I guess how less and sass build a final file, also would be nice to have a flag for minification?

from myth.

ianstormtaylor avatar ianstormtaylor commented on June 11, 2024

if someone wants to try PRing this i'd be happy to help get it merged in this coming weekend or something. the tricky part i ran into if i remember correctly was the source mapping for the imported files which i think the current import plugins don't handle well. maybe we just say screw source maps for now

from myth.

krry avatar krry commented on June 11, 2024

+1, willing to help but not sure where to start.

from myth.

martinkr avatar martinkr commented on June 11, 2024

+1
and i would suggest the following

variables.css

:root {
    var-accent: #f00;
}

sample.css

@import url(variables.css);
a {
    color: var(accent)
}
$ myth sample.css sample.css

output

sample.css

a {
    color: #f00
}

so it will just replace the vars and remove the @import so you you can keep all your separate css files and modifiy them later in the build process. e.g.: if you are using a cms which concats and minifies the files

from myth.

ianstormtaylor avatar ianstormtaylor commented on June 11, 2024

added in 1.0.0! you need to pass { source: '/path/to/source' } as an option so it can know where to read from

from myth.

Related Issues (20)

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.