Skip to content

how can you get globals on the exported object? #50

Closed

Description

@faceyspacey

I don't see why globals can't be exported just like locals, thereby giving you a consistent API in your components, i.e. so you don't have to juggle between using keys on a styles object and className strings.

Activity

  1. madyankin commented on Dec 16, 2016

    @madyankin
    Owner

    Nice idea! Could you make a pull request?

  2. axyz commented on Jun 4, 2020

    @axyz

    @Outpunk can you point us to what part of the code filters out globals? (not sure if it is in this repo or some css-modules nested dependencies).

    This would be useful for my use case in https://github.com/utilitycss/atomic as I use the keys in the json to delete rules that are not exported (e.g. whole css files coming from ICSS imports and composes) (https://github.com/utilitycss/atomic/blob/master/src/postcss/remove-unused-electrons.ts)

    I was thinking that I can parse the CSS and look for :global(.myClass) instances with a regexp and include them in the custom getJSON as "myClass": "myClass", but that sounds like a dirty solution and would be better to not remove them in the first place.

  3. madyankin commented on Jun 4, 2020

    @madyankin
    Owner
  4. madyankin commented on Jun 9, 2020

    @madyankin
    Owner

    @axyz I didn't forgot about this one. It has just a low priority among other my tasks. Hope, will dig into it this or next week

  5. axyz commented on Jun 9, 2020

    @axyz

    @Outpunk sure, let me know if it is something I can help with given a little guidance, it is not super urgent but I want to avoid to put workarounds in place if possible.

  6. axyz commented on Jun 23, 2020

    @axyz

    @Outpunk any update on this?

  7. madyankin commented on Jun 23, 2020

    @madyankin
    Owner

    @axyz I'm afraid, I have to rewrite the lib a bit first to avoid using dependencies css-modules/css-modules-loader-core#236 (comment)

  8. axyz commented on Jun 23, 2020

    @axyz

    do you think is still realistic to have the feature relatively quickly if you go for copy pasting the dependencies for now? Just need to know in order to decide to go for an alternative solution in the meanwhile or not.

  9. madyankin commented on Jun 23, 2020

    @madyankin
    Owner
  10. madyankin commented on Jun 23, 2020

    @madyankin
    Owner
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions