Color attribute: add color as an attribute to our components
See original GitHub issueThis makes dynamically changing attributes easier for the user, and it will be easier to manage internally. For example:
<button primary>Button</button>
will become
<button color="primary">Button</button>
Edit: I realized button is probably a bad example since it already has this attribute, but this will benefit components like ion-navbar
as well:
<ion-navbar color="secondary">
...
</ion-navbar>
or
<ion-navbar [color]="barColor">
...
</ion-navbar>
@Component({
templateUrl: 'build/pages/about/about.html'
})
export class AboutPage {
barColor: string;
constructor(private nav: NavController, platform: Platform) {
this.barColor = platform.is('android') ? 'primary' : 'light';
}
}
Edit: Components that will have the color input:
- Badge
- Button
- Checkbox
- Chip
- Icon
- Item (Item, Item Divider, List Header)
- Label
- Navbar
- Radio
- Searchbar
- Segment
- Spinner
- Tabs
- Toggle
- Toolbar
- Typography (headers, paragraphs, spans, etc.)
Issue Analytics
- State:
- Created 7 years ago
- Reactions:8
- Comments:14 (4 by maintainers)
Top Results From Across the Web
add color as an attribute to our components #7467 - GitHub
I would appreciate the possibility to set the colors of the <ion-searchbar> component icons on the fly. Currently we can use some ionic...
Read more >Applying color to HTML elements using CSS - MDN Web Docs
Applying color to HTML elements using CSS. This article is a primer introducing each of the ways CSS color can be used in...
Read more >color as an attribute in litelement custom element
I'm building a custom web component with LitElement and would like to give it a color attribute. I've got the color working but...
Read more >Use Attribute to set background Color on Lightning Compoents
Below is my Component and CSS where we are currently setting the background color statically. Component <aura:component implements=" ...
Read more >How To Change the Color of HTML Elements - DigitalOcean
In these examples, the color value is defined by color names. Try changing the color of text, image borders and <div> elements using...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@albrecht-jun-zhang You can use property binding for
full
as well:See: https://angular.io/docs/ts/latest/guide/template-syntax.html#!#property-binding
@brandyscarney I opened a new issue #7826 for my suggestion.