ginader / HTML5-placeholder-polyfill

Small and robust polyfill for the HTML5 placeholder attribut.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Does this support :placeholder-shown?

corysimmons opened this issue · comments

It'd be awfully sweet if it did. :O

Hey Cory,
thanks for the great suggestion!
I agree it would indeed be rather sweet!
It is, however, sadly impossible to polyfill the exact :syntax.
What I can and will do is to apply a class .placeholder-shown instead.
I'll implement this ASAP.
Wouldn't that be awefully sweet as well?
On Feb 25, 2016 7:24 PM, "Cory Simmons" notifications@github.com wrote:

It'd be awfully sweet if it did. :O


Reply to this email directly or view it on GitHub
#71.

I suppose.

How does Selectivizr and stuff work if we can't polyfill pseudos?

What Selectivizr is doing is to read all the linked stylesheets and
duplicate the rules that apply to the pseudo selectors and then rewrite the
CSS. This works only with CSS linked from the same domain (so it would fail
from CDNs). While this "somewhat works" it's rather flaky (check the last
paragraph on http://selectivizr.com/ ).
I prefer this to be robust.
On Feb 25, 2016 10:44 PM, "Cory Simmons" notifications@github.com wrote:

I suppose.

How does Selectivizr and stuff work if we can't polyfill pseudos?


Reply to this email directly or view it on GitHub
#71 (comment)
.

I think .placeholder-shown can work. Re-implementing a selector engine just for this seems like overkill. So syntax would work like:

input {
  &.placeholder-shown,
  &:placeholder-shown {
    background: orange;
  }
}

?

Exactly! I think this would be very elegant :-)

Awesome. Will be featuring your lib on TutsPlus this upcoming week. Thanks. =)

Woohoo! thanks @corysimmons :-)

No problem. Thanks for being an active/good maintainer. 👍 💯