question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support for Angular inline CSS

See original GitHub issue

I 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:

  1. it is always a typescript file
  2. The file will always be named with a suffix of .component.ts, example app.component.ts or foo-bar.component.ts
  3. There is a class decorator named @Component({}) which has an optional styles 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:closed
  • Created 4 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
paustintcommented, Jun 1, 2019

Thank you for doing this. If you are interested in contributing, let me know so I can invite you as a collaborator 👍

@Raathigesh - yes, I am interesting in contributing on an ongoing basis and would very much like to be a contributor.

1reaction
paustintcommented, May 30, 2019

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. 😃

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found