Support for Angular inline CSS
See original GitHub issueI just saw you featured on Changelog Nightly - that is how I found out about this library - http://nightly.changelog.com/2019/05/29/ 🎉
Is your feature request related to a problem? Please describe. Angular 8 allows CSS to be included in a component as a CSS-in-JS sort of flavor, and it would be create if Fabulous supported this.
The structure is this:
- it is always a typescript file
- The file will always be named with a suffix of
.component.ts
, exampleapp.component.ts
orfoo-bar.component.ts
- There is a class decorator named
@Component({})
which has an optionalstyles
array that can have one or more multi-line strings that are CSS classes- In practice, people do not have more than multi-line string.
- The styles array is optional and may not exist.
Additional context Take a look at a code example below
import { Component } from '@angular/core';
@Component({
selector: 'app-my-component',
templateUrl: './app-my-component.html',
styles: [
`
.exists-label {
width: 115px;
display: inline-block;
}
.btn-all-diffs {
min-width: 130px;
}
.sticky-bottom {
position: fixed; /* Fixed/sticky position */
bottom: 50px; /* Place the button at the bottom of the page */
right: 30px; /* Place the button 30px from the right */
z-index: 99; /* Make sure it does not overlap */
}
.show {
display: block;
}
.hide {
display: none;
}
`,
],
})
export class MyComponent {
...
}
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Component styles - Angular
The Angular CLI command ng generate component defines an empty styles array when you create the component with the --inline-style flag.
Read more >Angular Cli support for inline templates and css - Stack Overflow
In the current version of the CLI (version 6) I just created a new project with ng new foo -s -t . The...
Read more >Adding the Angular 12 inline scss support : WEB-51018
Adding the Angular 12 inline scss support ... Hello,. I just tried with an @import like this and it works: styles: [ //language=scss...
Read more >Angular 12 tutorial #8 Component with Inline Style & Template
In this angular 12 version video, we learn about components with inline style and inline template and learn how to make and use...
Read more >Syntax highlighting for inline styles other than CSS · Issue #1255
Angular extension provides syntax highlighting for inline styles: Currently ... style is always CSS: vscode-ng-language-service/package.json ...
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
@Raathigesh - yes, I am interesting in contributing on an ongoing basis and would very much like to be a contributor.
I think that I could probably help out with this feature. I first need to learn the codebase and figure out how it works, then I can give it a shot. I will put it on my list of things to do. 😃