Closed DJTB closed 7 years ago
I've just pushed 2.60.0 that removes the constraint I placed on snippets from working inside styled-components. I would suggest you use a scope of .source.inside-js.css.styled
Amazing :100:
@DJTB where you able to make snippets work inside a styled component?
@tenjojeremy Inside of any of the following it works fine.
css`
/* snippet tab complete */
`;
styled(Component)`
/* snippet tab complete */
`;
styled.div`
/* snippet tab complete */
`;
But not a plain template literal:
const someStyles = `
color: blue;
/* snippet won't work */
`;
My snippet (note the source scope):
# Styled Components
'.source.inside-js.css.styled':
'SC prop destructure':
prefix: 'scp',
body: "${({ $1 }) => $1 && $2 }"
@DJTB Thank you fellow coder!
@DJTB I want to try it. What do I download?
@c0debreaker Open your snippets in Atom via the command palette and add the snippet?
Then use scp[TAB]
in the appropriate scope (see previous comment).
I love the syntax highlighting available when using styled-components as so:
However, I'm trying to get some atom snippets working to save myself repetitive typing. I can't seem to get the snippet to show in autocomplete while between the styled template literal backticks.
In my
snippets.cson
I've triedThe snippet will show for autocomplete throughout the rest of the file; as soon as I move the caret into the css syntax highlighted area, the snippet won't show. Is there a particular source I need to target to have it show?
*
,source.js
, or evensource.css
won't seem to apply it within that zone.Thanks for all your hard work, everything else works like a dream.