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.

type safe inline css

See original GitHub issue

When I use inline css in an html or jsp file, IntelliJ gives me nice syntax coloring and autocompletion: css-ide

Is there a type safe way to do inline css using kotlinx.html other than using a string? Or at least a way to get autocompletion and syntax coloring?

body {
    div {
        style = "background: yellow;border: solid thin blue"
    }
}

Issue Analytics

  • State:open
  • Created 7 years ago
  • Reactions:4
  • Comments:11 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
Miha-x64commented, Oct 30, 2017

It would be cool for CSS classes to be real things on the level of Kotlin language, so unused classes will be grey in IDE and may be stripped, and used classes may be automatically renamed to have names consisting of 1-2 chars. I mean, DSL should not just repeat CSS itself, but add some extra safety, performance, etc.

2reactions
marshallpiercecommented, Aug 27, 2018

I’m using https://github.com/olegcherr/Aza-Kotlin-CSS (via an unsafe block) and it works fine for me so far.

Read more comments on GitHub >

github_iconTop Results From Across the Web

6. Type Safe CSS · TornadoFX Guide - edvin
Type -Safe CSS · Inline CSS · Applying Style Classes with Stylesheets · Multi-Value CSS Properties · Nesting Styles.
Read more >
Type Safe CSS · edvin/tornadofx Wiki - GitHub
TornadoFX has a type safe DSL for generating CSS, including type safe ... You can even use type safe styles for inline style...
Read more >
CSP Allow Inline Styles - Content Security Policy
When you have a Content-Security-Policy header defined, the browser will automatically block inline style (unless you implement one of the workarounds ...
Read more >
CSP: style-src - HTTP - MDN Web Docs - Mozilla
To allow inline styles, 'unsafe-inline' , a nonce-source or a hash-source that matches the inline block can be specified. Content-Security- ...
Read more >
CSS Web Safe Fonts - W3Schools
Best Web Safe Fonts for HTML and CSS · Arial (sans-serif) · Verdana (sans-serif) · Tahoma (sans-serif) · Trebuchet MS (sans-serif) · Times...
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