@only directive
See original GitHub issueIdea is to define a block which will be used in particular selector if rule is true. And all other properties in whole selector should be skipped. As a simple example: main.scss
body {
background: #000;
@only $forIE8 {
background: #FFF;
}
@only $forIE9 {
background: #CCC;
}
}
ie8.scss
$forIE8: true;
@import "main";
ie9.scss
$forIE9: true;
@import "main";
all.scss
$forIE8: false;
@import "main";
Output: ie8.css
body {
background: #FFF;
}
ie9.css
body {
background: #CCC;
}
all.css
body {
background: #000;
}
Issue Analytics
- State:
- Created 9 years ago
- Comments:7 (1 by maintainers)
Top Results From Across the Web
Digit Only Directive in Angular - codeburst
Digit Only Directive in Angular. Natural numbers are frequently used as Account Numbers, Transaction IDs, Job Codes, etc.
Read more >Angular DigitOnly Directive and Mask Directive - GitHub
An Angular directive only allows [0-9] in the input box when typing, pasting or drag/dropping. This directive handles both Windows keyboard and Mac...
Read more >READ-ONLY directive - Micro Focus
The READ-ONLY directive allows you to make some fields (columns) of data read-only, while preserving normal access to other fields/columns.
Read more >ngx-numbers-only-directive - npm
An angular directive for input element that allows only numeric values. Latest version: 1.0.2, last published: 2 years ago.
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 FreeTop 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
Top GitHub Comments
FWIW, I thought this directive would be helpful as well. I’ve written a
postcss
plugin based on this syntax here: https://github.com/wheeyls/postcss-only-directive.@if
and@else
are sufficient for this use case.