CSS mixin api
See original GitHub issueIs your feature request related to a problem? Please describe.
CSS syntax highlighting is built based on premise that CSS code is wrapped with css tagged template literal. Without the tag syntax highlighting does not work.
Describe the solution you’d like
Even if there is no use case for it, provide a dummy css tagged template literal that could be used simply to enable compatibility with the existing code editors, e.g.
import {
css,
styled,
} from '@compiled/css-in-js';
const mixin = css`
font-size: 12px;
`;
<div
css={css`
${mixin};
color: red;
`}
/>
<div
css={[mixin, { color: 'red' }]}
/>
To produce this CSS:
font-size: 12px;
color: red;
Testing notes
- Used inline in a CSS prop
- Used in a local variable
- Used from a import
- Used in CSS prop array
- Dynamic CSS interpolations
- Static CSS interpolations
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (5 by maintainers)
Top Results From Across the Web
Sass: @mixin and @include
This makes it easy to define flexible mixin APIs that can be used in simple or complex ways. SCSS; Sass; CSS. SCSS Syntax....
Read more >Sass @mixin and @include - W3Schools
The @mixin directive lets you create CSS code that is to be reused throughout the website. The @include directive is created to let...
Read more >Sass - Mixins - TutorialsTeacher
There are CSS frameworks around they try to address the problem. ... The mixin in the above example is defined in the same...
Read more >CSS Mixins
Mixins allow document authors to define patterns of property value pairs, ... The following example includes both the defined mixin .clearfix and the ......
Read more >5 PRACTICAL SCSS MIXIN EXAMPLES - Codipher
The SCSS mixin “prefixer” takes property as an argument and adds browser prefixes to them. For example, if Google Chrome doesn't support a ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Cool @sonatard. Thanks for that. We will merge #341 asap. Your contributions are always welcome. 😃 ❤️
That’s good!! I’m looking forward to it. If #341 will be merged, I will Introduce Compiled in Japan. And Congratulations! 1000 Stars! I was waiting for Atomic CSS by stylex from last year, but they were never released by Facebook. I was excited when I found Compiled.