Skip to content

feat(tools): setup TailwindCSS in ui-components - #42153

Merged
raisedadead merged 1 commit into
freeCodeCamp:mainfrom
huyenltnguyen:feat/setup-tailwind
May 17, 2021
Merged

raisedadead merged 1 commit into
freeCodeCamp:mainfrom
huyenltnguyen:feat/setup-tailwind

Conversation

@huyenltnguyen

Copy link
Copy Markdown
Member

Checklist:

  • I have read freeCodeCamp's contribution guidelines.
  • My pull request has a descriptive title (not a vague title like Update index.md)
  • My pull request targets the main branch of freeCodeCamp.
  • All the files I changed are in the same world language, for example: only English changes, or only Chinese changes, etc.

Ref #41580

This PR adds basic TailwindCSS setup to ui-components. Setup steps are:

  1. Started with the installation guide (https://tailwindcss.com/docs/installation#installing-tailwind-css-as-a-post-css-plugin)
  2. Installed the postcss-import plugin
  3. Created a config file for Tailwind (https://tailwindcss.com/docs/installation#create-your-configuration-file)
  4. Created global.css to include all the Tailwind import (https://tailwindcss.com/docs/installation#include-tailwind-in-your-css)
  5. Tested the setup by adding a custom color in the config file and applying it to the Button component via a class name

Screenshot

Before After
Screen Shot 2021-05-16 at 22 42 16 Screen Shot 2021-05-16 at 22 43 20

@gitpod-io

gitpod-io Bot commented May 16, 2021

Copy link
Copy Markdown

@github-actions github-actions Bot added the scope: tools/scripts Scripts for supporting dev work, generating config and build artifacts, etc. label May 16, 2021
Comment on lines +34 to +36
.fcc-style {
@apply bg-darkGreen;
}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This is just to validate that tailwind is working. The button does not match our styles and its implementation needs to be updated (IMO). I am planning to tear it down and rebuild it in a coming up PR as the pilot component.

Comment on lines +5 to +8
colors: {
// Configure the color palette here
darkGreen: '#00471b'
}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I think we can start adding the color tokens in after this PR gets merged, and the task can be open for new contributors. The color list should contain layout colors and accent colors.

Comment on lines +10 to +13
variants: {
extend: {}
},
plugins: []

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

These are just placeholders that npx tailwindcss init added.

@huyenltnguyen
huyenltnguyen marked this pull request as ready for review May 16, 2021 16:18
@huyenltnguyen
huyenltnguyen requested a review from a team May 16, 2021 16:18
@huyenltnguyen huyenltnguyen mentioned this pull request May 16, 2021
7 of 43 tasks
@raisedadead
raisedadead merged commit ed09452 into freeCodeCamp:main May 17, 2021
@huyenltnguyen
huyenltnguyen deleted the feat/setup-tailwind branch May 17, 2021 08:46
@ahmaxed ahmaxed mentioned this pull request Jan 4, 2022
37 of 49 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope: tools/scripts Scripts for supporting dev work, generating config and build artifacts, etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants