From 96443857fe0ab4199faf5b976a82079b11217e08 Mon Sep 17 00:00:00 2001 From: Jonny Scholes Date: Thu, 7 Mar 2019 11:00:59 +1100 Subject: [PATCH 01/11] Start breaking scss up into multiple files and start BEM-ification --- .storybook/config.js | 2 +- example/example.scss | 8 ++-- package.json | 2 +- src/AddButton.js | 2 +- src/BlocksContainer.js | 2 +- src/StructChildField.js | 2 +- src/scss/_config.scss | 24 ++++++++++ src/scss/components/c-sf-add-button.scss | 32 +++++++++++++ src/scss/components/c-sf-container.scss | 54 +++++++++++++++++++++ src/{ => scss}/index.scss | 61 +++--------------------- 10 files changed, 126 insertions(+), 63 deletions(-) create mode 100644 src/scss/_config.scss create mode 100644 src/scss/components/c-sf-add-button.scss create mode 100644 src/scss/components/c-sf-container.scss rename src/{ => scss}/index.scss (83%) diff --git a/.storybook/config.js b/.storybook/config.js index 0126cd9..bf23bbb 100644 --- a/.storybook/config.js +++ b/.storybook/config.js @@ -2,7 +2,7 @@ import { configure } from "@storybook/react"; configure(() => { require("../example/example.scss"); - require("../src/index.scss"); + require("../src/scss/index.scss"); require("../example/index.story"); }, module); diff --git a/example/example.scss b/example/example.scss index ffb3b59..d364b48 100644 --- a/example/example.scss +++ b/example/example.scss @@ -3,12 +3,12 @@ body { padding: 15px; } -.children-container .block > .block-container > .content-container > .content.full { +.streamfield-container .block > .block-container > .content-container > .content.full { padding: 0; } -.children-container .block > .block-container > .content-container > .content.full input, -.children-container .block > .block-container > .content-container > .content.full textarea { +.streamfield-container .block > .block-container > .content-container > .content.full input, +.streamfield-container .block > .block-container > .content-container > .content.full textarea { display: block; min-width: 100%; max-width: 100%; @@ -18,7 +18,7 @@ body { outline: none; } -.children-container .block > .block-container > .content-container > .content.full input { +.streamfield-container .block > .block-container > .content-container > .content.full input { font-size: 30px; } diff --git a/package.json b/package.json index 13d0b38..9e16c70 100644 --- a/package.json +++ b/package.json @@ -125,7 +125,7 @@ } }, "scripts": { - "build": "rollup -c && build-storybook -c .storybook -s example -o public && sass src/index.scss | npx postcss --use autoprefixer --no-map > dist/react-streamfield.css", + "build": "rollup -c && build-storybook -c .storybook -s example -o public && sass src/scss/index.scss | npx postcss --use autoprefixer --no-map > dist/react-streamfield.css", "start": "start-storybook -c .storybook -s example -p 9001", "test": "jest", "test:watch": "jest --watch", diff --git a/src/AddButton.js b/src/AddButton.js index cc7e072..c681ea7 100644 --- a/src/AddButton.js +++ b/src/AddButton.js @@ -111,7 +111,7 @@ class AddButton extends React.Component { const button = ( diff --git a/src/BlocksContainer.js b/src/BlocksContainer.js index 4a78b0c..675b1fb 100644 --- a/src/BlocksContainer.js +++ b/src/BlocksContainer.js @@ -60,7 +60,7 @@ class BlocksContainer extends React.Component { {(provided, snapshot) => (
-