Commit 7045bd11 by Ari Rizzitano

implement CssJail

parent 8b56a117
import { configure } from '@storybook/react';
import React from 'react';
import { configure, addDecorator } from '@storybook/react';
import { setOptions } from '@storybook/addon-options';
import CssJail from '../src/CssJail';
setOptions({
name: '💎 PARAGON',
url: 'https://github.com/edx/paragon',
......@@ -9,6 +12,12 @@ setOptions({
const req = require.context('../src', true, /\.stories\.jsx$/);
addDecorator(story => (
<CssJail>
{story()}
</CssJail>
));
function loadStories() {
require('./Paragon.stories.jsx');
req.keys().forEach((filename) => req(filename));
......
.css-jail {
@import "~bootstrap/scss/_reboot";
-ms-text-size-adjust: 100%;
-webkit-text-size-adjust: 100%;
box-sizing: border-box;
line-height: 1.15;
font-size: $font-size-base;
font-weight: $font-weight-base;
line-height: $line-height-base;
margin: 0;
color: $body-color;
background-color: $body-bg;
}
import React from 'react';
import PropTypes from 'prop-types';
import styles from './CssJail.scss';
function CssJail({ children }) {
return (
<div
style={{ fontFamily: 'sans-serif' }}
className={styles['css-jail']}
>
{children}
</div>
);
}
CssJail.propTypes = {
children: PropTypes.element.isRequired,
};
export default CssJail;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment