Git Product home page Git Product logo

Comments (14)

eeue56 avatar eeue56 commented on August 22, 2024

You're not wrong. There used to be a css-helpers package, but I'm not sure of @rtfeldman's long term plan. Maybe worth opening a PR for it?

from elm-css.

eeue56 avatar eeue56 commented on August 22, 2024

cc @rtfeldman this is a slight blocker 🎯

from elm-css.

jgillich avatar jgillich commented on August 22, 2024

This is fixed and can be closed, right?

from elm-css.

SerialVelocity avatar SerialVelocity commented on August 22, 2024

Possibly. I saw Css.Namespace was removed again. What has it been replaced by?

from elm-css.

jgillich avatar jgillich commented on August 22, 2024

Nevermind, Css.Namespace still appears to be missing..

from elm-css.

SerialVelocity avatar SerialVelocity commented on August 22, 2024

It was added by e825047 but removed again by ec9661d

from elm-css.

eeue56 avatar eeue56 commented on August 22, 2024

Css.Helpers.namspace now has .rules, which is the scoped version of the old Css.Namespace.namespace

from elm-css.

jgillich avatar jgillich commented on August 22, 2024

Is the example in the README supposed to work?

Detected errors in 1 module.
-- TYPE MISMATCH ------------------------------------------ ./src/Stylesheet.elm

`namespacer` is being used in an unexpected way.

42│   (stylesheet << namespacer.rules)
                     ^^^^^^^^^^
Based on its definition, `namespacer` has this type:

    { class : ..., classList : ..., id : ..., name : ... }

But you are trying to use it as:

    { b | rules : ... }

from elm-css.

eeue56 avatar eeue56 commented on August 22, 2024

Not with 1.0.0 - I haven't pushed it yet since I'm trying to make sure that the next release will work for sure :)

from elm-css.

jgillich avatar jgillich commented on August 22, 2024

Ah I see, thanks!

from elm-css.

jessitron avatar jessitron commented on August 22, 2024

In 2.0.0, the solution is:

elm package install rtfeldman/elm-css-helpers

This contains Html.CssHelpers

and then the function of relevance is withNamespace:

(id, class, classList) = Html.CssHelpers.withNamespace "mynamespace"

This is necessary to use the CSS classes in a typesafe way.
Which is totally not obvious and can we please add this to the README?

from elm-css.

eeue56 avatar eeue56 commented on August 22, 2024

Yup! can you please make a PR for this?

from elm-css.

jessitron avatar jessitron commented on August 22, 2024

done: #110

from elm-css.

rtfeldman avatar rtfeldman commented on August 22, 2024

Thanks @jessitron! 🎉

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.