Feature: @Directive should support styles and styleUrls properties
## I'm submitting a ... <!-- Check one of the following options with "x" --> <pre><code> [ ] Regression (behavior that used to work and stopped working in a new release) [ ] Bug report <!-- Please search github for a similar issue or PR before submitting --> [x] Feature request [ ] Documentation issue or request [ ] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question </code></pre> ## Current behavior Currently, if you have a `@Directive` that requires some custom styles you have to deal with the inclusion of styles, the `@Directive` does not accept `styles` and `styleUrls` (and maybe `encapsulation: None|Emulated`). ## Expected behavior The `DirectiveResolver` should accept `styles`, `styleUrls` (and `encapsulation: None|Emulated`) for the `@Directive` decorator. ## What is the motivation / use case for changing the behavior? ``` /** * Removes the spacing around an `md-list` component when it is a child of `md-card`. */ @Directive({ selector: 'md-list[my-md-list-in-card]', styles: [` md-list[my-md-list-in-card] { .mat-list-item-content { padding-left: 0 !important; padding-right: 0 !important; } } `] }) export class MyMdListInCardStylerDirective { } ```
Posted by SchnWalter on Jun 26, 2017, 9:58 AM
Tags
Related issues
- Add 65536 size support for maps
- TypeScript 7.1 Iteration Plan
- nvim-treeconfig: upstream nvim-treesitter
- Add the "action" and "method" attributes to <button>
- [FEATURE] Support multiple Connector accounts (same connector, different accounts) in Claude and Claude Code on the web (claude.ai/code)
- > We were imposed GitHub for so many exercises!
Raise real-world problems, find people facing the same issue, and discuss solutions.4,500 issues0 comments
support (Software)
Add 65536 size support for maps
TypeScript 7.1 Iteration Plan
nvim-treeconfig: upstream nvim-treesitter
Add the "action" and "method" attributes to <button>
[FEATURE] Support multiple Connector accounts (same connector, different accounts) in Claude and Claude Code on the web (claude.ai/code)
> We were imposed GitHub for so many exercises!
Add support for Visual Studio 2026 Integration
Support for Helm v4
Feature: @Directive should support styles and styleUrls properties
## I'm submitting a ... <!-- Check one of the following options with "x" --> <pre><code> [ ] Regression (behavior that used to work and stopped working in a new release) [ ] Bug report <!-- Please search github for a similar issue or PR before submitting --> [x] Feature request [ ] Documentation issue or request [ ] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question </code></pre> ## Current behavior Currently, if you have a `@Directive` that requires some custom styles you have to deal with the inclusion of styles, the `@Directive` does not accept `styles` and `styleUrls` (and maybe `encapsulation: None|Emulated`). ## Expected behavior The `DirectiveResolver` should accept `styles`, `styleUrls` (and `encapsulation: None|Emulated`) for the `@Directive` decorator. ## What is the motivation / use case for changing the behavior? ``` /** * Removes the spacing around an `md-list` component when it is a child of `md-card`. */ @Directive({ selector: 'md-list[my-md-list-in-card]', styles: [` md-list[my-md-list-in-card] { .mat-list-item-content { padding-left: 0 !important; padding-right: 0 !important; } } `] }) export class MyMdListInCardStylerDirective { } ```
Comments (0)
No comments yet. Start the discussion.