This will make it easier for users to have their own custom buttons instead of overriding our styles.
<a button>
becomes <a ion-button>
<button>
becomes <button ion-button>
@brandyscarney, wouldn't it be cleaner and more consistent to have a <ion-button>
element instead of a <button ion-button>
like
<ion-button>
Right Icon
<ion-icon name="star"></ion-icon>
</ion-button>
This may render a <button ion-button>
behind the scenes.
Hey @mpaland, thanks for the suggestion! The short answer is that using an attribute selector rather than an element selector allows us to gain all of the advantages of the native <button>
and <a>
elements, rather than passing all of the native functionality down and being difficult to maintain. This is something we have decided to do in line with the material team's implementation. They have put together a great document explaining the various reasons for this: https://docs.google.com/document/d/1m8IxhKu5qI8xwjePVGZMbRve3MTW9M8odgcPiuAZfoM/preview?pref=2&pli=1#
Brandy, thanx for pointing this out. Kara's doc makes your decision pretty clear. IMHO not 100% nice - but necessary.
Most helpful comment
Hey @mpaland, thanks for the suggestion! The short answer is that using an attribute selector rather than an element selector allows us to gain all of the advantages of the native
<button>
and<a>
elements, rather than passing all of the native functionality down and being difficult to maintain. This is something we have decided to do in line with the material team's implementation. They have put together a great document explaining the various reasons for this: https://docs.google.com/document/d/1m8IxhKu5qI8xwjePVGZMbRve3MTW9M8odgcPiuAZfoM/preview?pref=2&pli=1#