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.

[idea] pseudo inline styles

See original GitHub issue

An idea for handling CSS:

var bel = require('bel')
var css = {
  position: 'absolute',
  top: 100,
  left: 200
}
var element = bel`<div style=${css}>Hello!</div>`

Which would detect the style key and use dom-css to set the .style[prop] directly on the elements (CSP safe). It will even do vendor prefixing.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
yoshuawuytscommented, May 21, 2017

Agree with @shama. Yeah, also wouldn’t use this, but not opposed tho if people want it. It would need to be ported to yo-yoify and tested on both projects before we could land it

On Sun, May 21, 2017, 19:20 Charlike Mike Reagent notifications@github.com wrote:

Probably. But it cost nothing and DOM itself supports it. If anyone want more then he can use something like dom-css or such.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/shama/bel/issues/3#issuecomment-302950200, or mute the thread https://github.com/notifications/unsubscribe-auth/ACWlek5rUUmWhrcR4TI9RwcZzo5OYudEks5r8HJIgaJpZM4Hnzkh .

1reaction
shamacommented, May 21, 2017

Maybe it’s because I rarely use inline styles and when I do, it’s almost always directly on the element. Non-inline CSS is far superior IMO so this convenience isn’t useful to me.

But, if the overwhelming consensus is to add this back then we can.

Read more comments on GitHub >

github_iconTop Results From Across the Web

CSS Pseudo-classes with inline styles
Think of inline styles as the styles applied to some anonymous super-specific ID selector: those styles only apply to that one very element...
Read more >
Is there a way to create an inline style for a CSS pseudo- ...
Normalize ( type all the tags you will be using at first and declare null values in them i.e margin,border, padding ) ·...
Read more >
[Proposal] Expand inline style='' attributes to allow pseudo- ...
In a recent email to www-style, James Kyle asks for the ability to use inline styles (the style attribute) to style an element...
Read more >
Re: dynamic states and pseudo elements for inline styles
And the first step is done: > https://discourse.wicg.io/t/proposal-expand-inline-style-attributes-to-allow-pseudo-class-element-styling/1812 ...
Read more >
Inline Styles: Yes or No?
These libraries sought to solve some of the limitations that come with using inline styles, most notably lack of support for pseudo-selectors, ...
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