Responsive text color for core-scroll-header-panel

143 views
Skip to first unread message

lex.a...@gmail.com

unread,
Aug 30, 2014, 7:10:05 AM8/30/14
to polym...@googlegroups.com
Hey guys, thanks for all the great work!

I am trying to set up a core-scroll-header-panel with a background image for #headerBg and a background-color for #condensedHeaderBg like in Rob Dodson's I/O-14 demo, but get stuck with defining text colors. 

The problems is that you are typically choosing a contrasting color for text sitting on top of a background-image within the header panel, but when you add a background color that appears when users scroll down and the background images fades away, you would probably often want that background color to be contrasting to the background image as well, which would make the text unreadable.

So, I would probably need a method to add a color property to #core_sroll_header_panel whenever #condensedHeaderBg is triggered by the scroll event. Would that be feasible somehow? 

Lex

Frankie Fu

unread,
Aug 30, 2014, 6:22:15 PM8/30/14
to lex.a...@gmail.com, polymer-dev
There is an event "core-header-transform" that you can listen for header transform changes.  Here is a jsbin showing how you can use it to adjust font color:

We need to add docs for this and should probably make this easier (https://github.com/Polymer/core-scroll-header-panel/issues/3)



Follow Polymer on Google+: plus.google.com/107187849809354688692
---
You received this message because you are subscribed to the Google Groups "Polymer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to polymer-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/polymer-dev/d1d4acc3-4476-429a-a0ec-b4000c90f56b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

lex.a...@gmail.com

unread,
Aug 31, 2014, 4:05:13 AM8/31/14
to polym...@googlegroups.com, lex.a...@gmail.com
Wow! Just wow. 
Glad to know where to find someone who really knows what he's doing. You shouldn't work on weekends, though!
Reply all
Reply to author
Forward
0 new messages