Back to Storybook

SCSS example

docs/_snippets/my-component-with-custom-syntax-highlight.md

10.3.6572 B
Original Source
<!-- prettier-ignore -->
mdx
import { Meta } from '@storybook/addon-docs/blocks';
import { Prism as SyntaxHighlighter } from 'react-syntax-highlighter';

<Meta title="A Storybook doc with a custom syntax highlight for SCSS" />

# SCSS example

This is a sample SCSS code block example highlighted in Storybook

"scss
$font-stack: Helvetica, sans-serif;
$primary-color: #333;

body {
  font: 100% $font-stack;
  color: $primary-color;
}
"

export const Component = () => {
  return <SyntaxHighlighter/>;
};