From 9686be097c03cbfc00fc5273113939bc91fbb242 Mon Sep 17 00:00:00 2001 From: Alex Barbato Date: Wed, 24 Oct 2018 17:42:51 -0400 Subject: [PATCH 1/3] Offensively ugly, yet functioning SCSS integration. To remove parts and clean up now --- {{cookiecutter.repo_name}}/.env | 1 + {{cookiecutter.repo_name}}/README.md | 9 + {{cookiecutter.repo_name}}/package.json | 6 +- .../src/components/Header.js | 3 +- .../src/components/thing.scss | 10 + {{cookiecutter.repo_name}}/src/index.js | 1 + .../src/styles/scss/_settings.scss | 33 ++ .../src/styles/scss/_utilities.scss | 68 ++++ .../src/styles/scss/app.scss | 2 + {{cookiecutter.repo_name}}/yarn.lock | 349 +++++++++++++++++- 10 files changed, 463 insertions(+), 19 deletions(-) create mode 100644 {{cookiecutter.repo_name}}/.env create mode 100644 {{cookiecutter.repo_name}}/src/components/thing.scss create mode 100644 {{cookiecutter.repo_name}}/src/styles/scss/_settings.scss create mode 100644 {{cookiecutter.repo_name}}/src/styles/scss/_utilities.scss create mode 100644 {{cookiecutter.repo_name}}/src/styles/scss/app.scss diff --git a/{{cookiecutter.repo_name}}/.env b/{{cookiecutter.repo_name}}/.env new file mode 100644 index 0000000..7b8a211 --- /dev/null +++ b/{{cookiecutter.repo_name}}/.env @@ -0,0 +1 @@ +NODE_PATH=src/ diff --git a/{{cookiecutter.repo_name}}/README.md b/{{cookiecutter.repo_name}}/README.md index f674b5b..89486b2 100644 --- a/{{cookiecutter.repo_name}}/README.md +++ b/{{cookiecutter.repo_name}}/README.md @@ -15,6 +15,15 @@ $ nvm use $ yarn ``` +#### Using a pre-processor +Should you wish to use SCSS instead of styled-components, +SASS comes pre-included in this package. + +**Generally this is desired should javacript being required on the front-end not be necessary for the application** + +1. Replace 'import './global.css';' with 'import './styles/scss/app.scss';' in index.js +2. You're done! Go forth and write your SCSS. + ## Quick Start ``` diff --git a/{{cookiecutter.repo_name}}/package.json b/{{cookiecutter.repo_name}}/package.json index 778304f..f517df7 100644 --- a/{{cookiecutter.repo_name}}/package.json +++ b/{{cookiecutter.repo_name}}/package.json @@ -6,15 +6,17 @@ "private": true, "dependencies": { "jest-dom": "^2.0.4", + "node-sass": "^4.9.4", "react": "^16.5.2", "react-dom": "^16.5.2", "react-helmet": "^5.2.0", "react-router-dom": "^4.3.1", "react-scripts": "2.0.5", "react-snapshot": "^1.3.0", + "react-testing-library": "^5.2.0", + "sass-loader": "^7.1.0", "serve": "^10.0.2", - "styled-components": "^3.4.10", - "react-testing-library": "^5.2.0" + "styled-components": "^3.4.10" }, "scripts": { "start": "react-scripts start", diff --git a/{{cookiecutter.repo_name}}/src/components/Header.js b/{{cookiecutter.repo_name}}/src/components/Header.js index 3d71a39..d1a6d81 100644 --- a/{{cookiecutter.repo_name}}/src/components/Header.js +++ b/{{cookiecutter.repo_name}}/src/components/Header.js @@ -1,6 +1,7 @@ import React from 'react'; import { Link } from 'react-router-dom'; import styled from 'styled-components'; +import "./thing.scss"; import Grid from './Grid'; import Column from './Column'; @@ -29,7 +30,7 @@ export default (props) => ( - {{ cookiecutter.project_name }} + {{ cookiecutter.project_name }}