-
-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
how can you get globals on the exported object? #50
Comments
Nice idea! Could you make a pull request? |
@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. |
I think I can take a look In a couple of days
… On 4 Jun 2020, at 17:56, Andrea Moretti ***@***.***> wrote:
@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.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
@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 |
@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. |
@Outpunk any update on this? |
@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) |
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. |
Hope to get an answer in a couple of days. Working on the deps now #108
… On 23 Jun 2020, at 12:49, Andrea Moretti ***@***.***> wrote:
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.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#50 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AABV73W4PJE2G6ZVN23G6WTRYB3BHANCNFSM4CZHNEBA>.
|
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.The text was updated successfully, but these errors were encountered: