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.

Do you want to request a feature or report a bug?

feature

What is the expected behavior?

To have the same modifiers syntax as in astroturf

const Button = styled('button')`
  color: black;
  border: 1px solid black;
  background-color: white;

  &.primary {
    color: blue;
    border: 1px solid blue;
  }

  &.color-green {
    color: green;
  }
`;

<Button primary color="green">

Compare to ${ } interpolation it keeps CSS syntax. CSS highlight and autocomplete works.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:12
  • Comments:30 (11 by maintainers)

github_iconTop GitHub Comments

2reactions
satya164commented, Oct 2, 2018

How do you scope keyframes? Or what if I don’t want to scope class

Currently, we use stylis as the parser (though planning to switch to postcss for few reasons) which handles scoped keyframes as well as :global.

Did I understand correctly that right now you collect all styles to the single file styles.css? How code splitting works?

We create separate CSS files for each JS file and add a require statement, which gets picked up by css loader. Code splitting works similar to when you import vanilla css files with mini-css-extract-plugin.

2reactions
aicommented, Oct 2, 2018
  1. data- attributes will be DOM
  2. It requires more symbols
  3. It is also a little hacky. data- attributes were created for a different purpose. People will not love them, as result it will not be syntax sugar feature for linaria as it works for astroturf.
Read more comments on GitHub >

github_iconTop Results From Across the Web

Modifier (Java Platform SE 7 ) - Oracle Help Center
The Modifier class provides static methods and constants to decode class and member access modifiers. The sets of modifiers are represented as integers...
Read more >
Java Modifiers - W3Schools
The public keyword is an access modifier, meaning that it is used to set the access level for classes, attributes, methods and constructors....
Read more >
Modifier classes - Pivotal UI
A modifier is a tiny CSS class that has one job (e.g., it sets a single CSS property). They are sometimes called utility...
Read more >
Access Modifiers in Java - GeeksforGeeks
As the name suggests access modifiers in Java help to restrict the scope of a class, constructor, variable, method, or data member.
Read more >
Naming - BEM
Spaces in complicated modifiers are replaced by dash. Modifier is an extra class name which you add to a block/element DOM node. Add...
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