Using Element Queries (EQCSS) with GSS?

51 views
Skip to first unread message

David Becker

unread,
Aug 20, 2016, 9:31:24 PM8/20/16
to GWT Users
I am interesting in using element queries (see http://elementqueries.com/) within GSS resources. Of course, GSS doesn't recognize the @element rules and emits an error. 

Does anyone has any suggestions on how I might get this working?

Thanks!

Jens

unread,
Aug 21, 2016, 9:55:45 AM8/21/16
to GWT Users
Its more like that Closure Stylesheets does not recognize @element. Given that its not a CSS spec but just a syntax for the element queries JS library Closure Stylesheet probably won't implement support for it.

For now your best bet is to use a TextResource and inject your EQCSS manually using StyleInjector. To target an element using @element you would need to mark that CSS class as external in case its part of a CssResource so it won't be renamed by GWT.

-- J.

David Becker

unread,
Aug 21, 2016, 10:45:20 AM8/21/16
to google-we...@googlegroups.com
Yeah, that's what I meant by GSS. EQCSS looks like a very powerful and useful concept - I hope it does become genuine CSS some day. 

Unfortunately, using a separate TextResource isn't quite what I'm looking for. I want the best of both worlds. :)
--
You received this message because you are subscribed to a topic in the Google Groups "GWT Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-web-toolkit/TwNNNzRk1sY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-web-toolkit+unsub...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.


--
-.. .- ...- .. -.. ... -... . -.-. -.- . .-.
This message was sent from my mobile phone. Please excuse any typos or auto-corrections I might have missed.

Jens

unread,
Aug 21, 2016, 11:56:04 AM8/21/16
to GWT Users

Unfortunately, using a separate TextResource isn't quite what I'm looking for. I want the best of both worlds. :)

Hm looking at the syntax of EQCSS again, it seems that you have to fork GWT anyways, because even if GSS would allow @element you would still need to obfuscate the selector (css id of class) if its a non-external css class/id managed by CssResource.

Alternatively you could try to implement your own EqCssResource and write your own EqCssResourceGenerator since the ClientBundle/Resource mechanism is extendable in GWT for custom resources.

-- J.

David Becker

unread,
Aug 21, 2016, 12:04:54 PM8/21/16
to google-we...@googlegroups.com
Thanks for the suggestions, Jens. I'll do some experiments and see what happens.


On Sunday, August 21, 2016, Jens <jens.ne...@gmail.com> wrote:
--
You received this message because you are subscribed to a topic in the Google Groups "GWT Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-web-toolkit/TwNNNzRk1sY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-web-toolkit+unsub...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages