Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add postCSS to Gazebo #23

Merged
merged 4 commits into from
Nov 16, 2020
Merged

Add postCSS to Gazebo #23

merged 4 commits into from
Nov 16, 2020

Conversation

TerrySmithDC
Copy link

@TerrySmithDC TerrySmithDC commented Nov 16, 2020

Setups rescripts with postcss, tailwind, autoprefixed, and font magician.

Tailwind

  • Config taken from codecov-ui for easier component conversion

Font Magician

  • Generates needed font faces, for now we're loading Lato from Google.
  • Font Magician can be set up with our other licensed font (also used in designs) in a later PR.

CRA was very troublesome to set up with tailwind/PostCSS. I settled on extending the CRA config using rescripts. This allows us to use tailwind both in the globals.css file and in css modules with fast refreshing vs using the tailwindcss cli method the internet commonly opts for.

Currently CRA doesn't allow the use of PostCSS 8 and some dependencies latest versions use PostCSS 8. Auto prefixed and font magician are both on slightly older versions to maintain compatibility

There's currently a PR to make PostCSS version a peer dependency, we'll need either that or for CRA to update their postCSS version in order to keep up with our PostCSS plugins in the future. Atm both dependencies are locked in to not prompt dependabot to upgrade.
facebook/create-react-app#9716

I tested npm start and npm build, auto prefixed, font magicial, and tailwindcss were all generating the correct final css file.

I moved App and the main css around a bit to better represent our folder structure plans. I can update this, not sure how far Dorian and I have diverged here.

@netlify
Copy link

netlify bot commented Nov 16, 2020

Deploy preview for gazebo ready!

Built with commit dfe5152

https://deploy-preview-23--gazebo.netlify.app

@codecov
Copy link

codecov bot commented Nov 16, 2020

Codecov Report

Merging #23 (dfe5152) into main (d0a30de) will not change coverage.
The diff coverage is 0.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main      #23   +/-   ##
=======================================
  Coverage   59.67%   59.67%           
=======================================
  Files          11       11           
  Lines          62       62           
  Branches        9        9           
=======================================
  Hits           37       37           
  Misses         23       23           
  Partials        2        2           
Impacted Files Coverage Δ
src/components/App.js 100.00% <ø> (ø)
src/components/pages/About.js 0.00% <0.00%> (ø)
src/components/pages/Home.js 0.00% <0.00%> (ø)
src/index.js 0.00% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d0a30de...dfe5152. Read the comment docs.

Copy link
Contributor

@dorianamouroux dorianamouroux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job!

Comment on lines 106 to 121
variants: {
text: ['default', 'hover', 'focus', 'disabled'],
backgroundColor: ['default', 'responsive', 'hover', 'focus', 'disabled'],
opacity: ['default', 'responsive', 'hover', 'focus', 'disabled'],
textColor: [
'default',
'responsive',
'hover',
'focus',
'disabled',
'visited',
],
borderColor: ['default', 'responsive', 'hover', 'focus', 'disabled'],
cursor: ['default', 'responsive', 'disabled'],
textOpacity: ['default', 'responsive', 'hover', 'focus', 'disabled'],
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we take the default configuration on it, and we update it as we need?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I was debating that, the only reason I left this was I wasn't sure what level of copy and pasting we'd be doing from UI. I'll clean this up.

@TerrySmithDC TerrySmithDC merged commit 2a11ec0 into main Nov 16, 2020
@TerrySmithDC TerrySmithDC deleted the CE-2619-tailwind branch November 16, 2020 20:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants