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.

Compatible with stylus-like syntax

See original GitHub issue
const Title = styled.h1`
  font-size: 1.5em;
  text-align: center;
  color: palevioletred;
`;

const Wrapper = styled.section`
  padding: 4em;
  background: papayawhip;
`;

Compare with below:

const Title = styled.h1`
  font-size 1.5em
  text-align center
  color palevioletred
`

const Wrapper = styled.section`
  padding 4em
  background papayawhip
`

Painful to write a ; at the end of the line, hope stylus-like syntax is supported here.

I guess it is possible to be serialized through some simple rules: adding a ; by line; adding : by first space.

ref: http://stylus-lang.com/

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:25
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

38reactions
geelencommented, May 3, 2017

Sorry, but I want to keep the CSS in Styled Components as close to vanilla CSS as possible, with the exception of nesting and autoprefixing. Anything else could potentially lead to very confusing behaviour, particularly when it comes to interpolations.

If you’re finding things like : and ; painful potentially you’re writing too much CSS. Try breaking out snippets and bringing them in with interpolations, that should make things a little nicer to work with.

6reactions
thysultancommented, Jun 13, 2017

Explored this a bit when working on the no-semicolon options though for different reasons – since i wanted to try and monkey-patch some common syntax errors i.e color red;.

So it is possible, you just have to do a lot more book keeping to avoid false positives since there are many valid ways you can write css selectors(involving whitespace) and properties that look syntactical similar without the colon.

Though it might not make it into s-c – but if you do have some ideas on the subject i’m open to input on implementations, the one i came up with at the time involved a 100% in/out approach to one format over the other.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Stylus | An expressive, robust, feature-rich CSS language built ...
CSS Compatible. Don't like indented syntax ? ok, it's optional! You can write stylus like css-style without pain. IDE support. Both VSCode (with...
Read more >
Looking for a Python CSS pre-processor with Stylus-like syntax?
Yes that's the bundle I'm using. It's just riddled with small issues that makes it tough to work with, for instance it enforces...
Read more >
Be a CSS Superhero with Stylus - YoungInnovations' Blog
Stylus like SASS or LESS is a CSS preprocessor which includes all essential ... Stylus has JavaScript like syntax and pattern which is...
Read more >
The best stylus for Android tablets and phones in 2022
... you might want an Android tablet stylus like Samsung's S-Pen, ... The Adonit Dash 4 is the best broadly compatible Android stylus...
Read more >
Is the Dell Active Pen compatible with the Inspiron 15-5578?
Hello CARRRMINE,. The Inspiron 5578 is a touchscreen model and you will require a capacitive stylus like http://dell.to/2rSlsKN. The screen on ...
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