You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Support styling components from outside with style hooks #10663
In Shadow DOM you can create style hooks using CSS custom properties. It is possible in polymer too with custom-css-mixins.
Angular should support style hooks / or style projections.
Here is the syntax:
@Component({selector: 'ns-button',template: ` <button> <i class="icon fa fa-fw fa-star"></i> <ng-content></ng-content> </button> `,styles: [` :host { display: inline-block; /* projects --ns-button styles, this is like <ng-content></ng-content> on the template level */ @apply(--ns-button); } .icon { height: auto; max-width: 35px; @apply(--ns-button-icon) } `]})classNsButton{}
@Component({selector: 'ns-app',template: `<ns-button>Click me!</ns-button>`,styles: [` ns-button { /* this is how you feed it with input, this is like ContentChild on the template level */ --ns-button: { background-color: green; border-radius: 4px; border: 1px solid gray; }; --ns-button-icon: { color: green; }; } `]})classNsApp{}
changed the title [-]Support styling component from outside with style hooks[/-][+]Support styling components from outside with style hooks[/+]on Aug 11, 2016
Thank you for submitting your feature request! Looks like during the polling process it didn't collect a sufficient number of votes to move to the next stage.
We want to keep Angular rich and ergonomic and at the same time be mindful about its scope and learning journey. If you think your request could live outside Angular's scope, we'd encourage you to collaborate with the community on publishing it as an open source package.
You can find more details about the feature request process in our documentation.
Activity
aegyed91 commentedon Aug 11, 2016
You can even use polymer components in angular2 and use polymer's css-mixins projection.
[-]Support styling component from outside with style hooks[/-][+]Support styling components from outside with style hooks[/+]zoechi commentedon Aug 18, 2016
Sounds like #2567, #6274
splincode commentedon Jul 25, 2018
@tsm91 Is the issue relevant? Maybe close the task...
angular-robot commentedon Jun 4, 2021
Just a heads up that we kicked off a community voting process for your feature request. There are 20 days until the voting process ends.
Find more details about Angular's feature request process in our documentation.
angular-robot commentedon Jun 24, 2021
Thank you for submitting your feature request! Looks like during the polling process it didn't collect a sufficient number of votes to move to the next stage.
We want to keep Angular rich and ergonomic and at the same time be mindful about its scope and learning journey. If you think your request could live outside Angular's scope, we'd encourage you to collaborate with the community on publishing it as an open source package.
You can find more details about the feature request process in our documentation.
angular-automatic-lock-bot commentedon Mar 4, 2022
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.