Git Product home page Git Product logo

Comments (5)

lukewestby avatar lukewestby commented on July 21, 2024

Hey! You can use the media function to nest style blocks under a media rule

elm-css/src/Css.elm

Lines 3525 to 3534 in 5181310

media : a -> List StyleBlock -> StyleBlock
media value styleBlocks =
let
getDeclarations name =
[ Declaration.ConditionalGroupRule
("@media \"" ++ toCssIdentifier value ++ "\"")
(List.concatMap (\(StyleBlock transform) -> transform name) styleBlocks)
]
in
StyleBlock getDeclarations

from elm-css.

jbalboni avatar jbalboni commented on July 21, 2024

@lukewestby This is what I see for that function in the 1.1.0 tag, which seems like it's only allowing you to pass MediaQuery values to the media function, and those values are only the different media types (print, screen, etc).

https://github.com/rtfeldman/elm-css/blob/1.1.0/src/Css.elm#L4111

from elm-css.

rtfeldman avatar rtfeldman commented on July 21, 2024

@jbalboni Ah, good point. I'd intended to expose a String -> MediaQuery function and apparently it slipped through the cracks. Sorry about that!

from elm-css.

rtfeldman avatar rtfeldman commented on July 21, 2024

Should also do the same for the other At-Rules, come to think of it.

from elm-css.

jbalboni avatar jbalboni commented on July 21, 2024

@rtfeldman Looks like this was fixed with #112, so I'm going to close it. Thought I'd tag you in case you wanted to make an issue for working with the other At-Rules.

from elm-css.

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.