Git Product home page Git Product logo

Comments (6)

andrewdavey avatar andrewdavey commented on June 25, 2024

This is a missing feature. I would think this needs to be configurable at the module level.

In web.config, something like this perhaps:

<cassette>
  <styles>
    <add path="styles/mobile" media="only screen and (max-device-width: 480px)" />
  </styles>
</cassette>

?

from cassette.

sfmskywalker avatar sfmskywalker commented on June 25, 2024

That would work out great for me, and is consistent with how everything else is configured in Cassette.

from cassette.

andrewdavey avatar andrewdavey commented on June 25, 2024

I'll leave this open, until the feature is implemented.

from cassette.

sfmskywalker avatar sfmskywalker commented on June 25, 2024

Great :)

from cassette.

andrewdavey avatar andrewdavey commented on June 25, 2024

In Cassette 0.6, the StylesheetModule class has a Media property. So it's now a matter of assigning the property in the configuration. A simple example is:

moduleSource.Add(new DirectorySource<StylesheetModule>("styles/mobile")
{
    FilePattern = "*.css",
    CustomizeModule = m => m.Media = "your-media-query-here"
});

However, I assume you'd rather use on PerSubDirectorySource<StylesheetModule> for all stylesheets and then set the media of a select few modules? So maybe we need to add something like:

/// after adding the module source...
moduleSource.Customize<StylesheetModule>("styles/mobile", m =>m.Media = "etc");

from cassette.

sfmskywalker avatar sfmskywalker commented on June 25, 2024

Great enhancements with 0.6!

I currently just use the DirectorySource class, but you you're right that I'd rather use the PerSubDirectorySource to save me from explicitly specifying each subfolder under /css.
I didn't realize I could then customize a module afterwards. Now I do :)

Thanks!

from cassette.

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.