Repository navigation
Closed
Labels
platform: learnUI side of the client application that needs familiarity with React, Gatsby etc.scope: UIThreads for addressing UX changes and improvements to user interface
Description
Problem:
Currently our HTML and CSS consist of the followings:
- A custom bootstrap 3 minified stylesheet injected in the head.
- React-boostrap component library.
- Custom styles to re-write the bootstrap styles due to changes in design style guide.
As a result, we would need to remove a lot of the unused styles, overwrites, and find a better way to manage our components.
Solution:
We should create our own component library that uses Storybook (isolate the components and document them) and tailwindCSS (style each component) and make sure they meet the web accessibility requirements.
I would roughly break the project down into smaller tasks, and the list can be adjusted as we go:
- Setup Storybook - feat(tools): create ui-components package and setup Storybook #41920
- Setup Tailwind CSS
- Basic Tailwind config - feat(tools): setup TailwindCSS in ui-components #42153
- Add color tokens to tailwind config (split to issue Add color tokens to tailwind config file #42186 for further discussion) - chore(tools): split color tokens to separate layers #42388
- Support dark mode feat: add tailwind theme support #43616
- Setup React Testing Library and its ESLint plugins - feat(tools): setup react testing library in ui-components #42221
- Setup TypeScript - feat(typescript): Add typescript support for UI components library #43541
- Setup Prettier & other ESLint rules - chore(eslint): use recommended configs for jsx-a11y #42818
- Setup css linter for custom CSS - related Creating freeCodeCamp's CSS Style guide #16445
- Package build and publication setup
- Setup Bundler (rollup/webpack/parcel) - feat: bundling for UI Components #42549
- Setup Publication (not for now)
- Write a guide for component development - @huyenltnguyen
- Build the following components
- Alert feat(tools): add Alert component #43835
- Button - @huyenltnguyen
- Col
- ControlLabel
- DropdownButton (maybe consider using Headless UI's Menu)
- Form
- FormControl
- FormGroup
- Grid
- HelpBlock
- Image
- Media
- MenuItem
- Modal (maybe consider using Headless UI's Dialog)
- Panel
- Row
- Tab
- TabPane
- Tabs
- Table
- ToggleButton (maybe consider using Headless UI's Switch)
- ToggleButtonGroup
- Remove the ToggleButton in
/components/helpersand replace it with the one above (? - I'm not sure, I haven't looked at the code closely, but I guess maybe there is a reason to split them) - Use
npm-linkto link the ui folder with /client - Replace
react-bootstrapcomponents with our own, one component at a time - Audit and clean up any unused CSS code
- Remove
@freecodecamp/react-bootstrapas a dependency - Remove the bootstrap stylesheet injection
- Remove all CSS from Learn
Lists were borrowed from @huyenltnguyen's comment below.
Reacted by Randell Dawson, Sem Bauke, Ismail Tlemcani, miku86, Huyen Nguyen, Kelvin Sánchez, Yuriy Putsan, Alex Suarez, Ivan Zulfikar, Tom and 1 more
Reacted by Yuriy Putsan and Hamza Waleed
Metadata
Metadata
Assignees
Labels
platform: learnUI side of the client application that needs familiarity with React, Gatsby etc.scope: UIThreads for addressing UX changes and improvements to user interface
Activity
Sembauke commentedon Mar 25, 2021
TailwindCSS: https://tailwindcss.com/docs/guides/create-react-app
StoryBook: https://storybook.js.org/docs/react/get-started/introduction
raisedadead commentedon Mar 26, 2021
Should this issue be consolidated back into #16445
ahmaxed commentedon Mar 26, 2021
For that we would use stylelint which would enforce a common css style. I would keep both issues separate, but link them since they are related.
prohackerzzz commentedon Mar 26, 2021
Can you please share some screenshots and elaborate more on this issue .I'm a newbie trying to contribute for the first time. Can you please help me??
Sembauke commentedon Mar 26, 2021
Hey @prohackerzzz,
This isn't really an issue it's rather an improvement of the codebase. You can check out the links I posted to familiarize yourself with the documentation. You may be able to contribute to this later.
ahmaxed commentedon Mar 30, 2021
@prohackerzzz, I think once we have replaced a couple of the components, it would be easer to contribute as a first timer then.
ahmaxed commentedon Mar 30, 2021
It seems like there is a catch with working on the components one by one.If we replace only one component, we would need to keep the injected bootstrap to keep the other components styled.
That would result in writing additional bootstrap rewrites for the new component.
huyenltnguyen commentedon Mar 31, 2021
@ahmadabdolsaheb I guess we could just build a set of new components first, then we could do incremental migrations when we deem they are ready.
Do we plan to use the components on other platforms too (code radio, news,...) or they will be /learn components only?
gracewest333 commentedon Apr 3, 2021
Hi, I am also a newbie who would love to help on this issue. @huyenltnguyen I think that's a good idea to do it incrementally.
ahmaxed commentedon Apr 4, 2021
@huyenltnguyen, I think here is the plan moving forward if we are planning to do incremental migration.
This is a great read: https://dev.to/nejremeslnici/migrating-tachyons-to-tailwind-css-part-i-ich
Please let me what you think.
Eventually we can reuse components across platforms; however, it is best to think about this component library built for learn at the moment to limit the scope of the migration.
Coderadio has very specific UI needs and not sure how modularity would improve it. Going headless with news is in the works but the use of client technologies are not finalized yet.
Ideally learn and news will have similar ui elements (walls of text, grid system, etc) and both could pull from storybook in the future.
JoshQuaintance commentedon Apr 7, 2021
I have worked with Storybooks before. I have used tailwind with Storybooks and Svelte, but I'm sure it can be changed into tailwind and React easily.
huyenltnguyen commentedon Apr 11, 2021
@ahmadabdolsaheb Thanks a lot! That sounds like a great plan. Now that it is up to us to be responsible for the components' HTML, what I would add as a criteria to our components is that they should be accessible and meet web accessibility requirements (https://www.w3.org/WAI/standards-guidelines/wcag/).
Here is the list of components that we are pulling from
@freecodecamp/react-bootstrap:[edited by @ahmadabdolsaheb]: There was a list of actionable items here that was moved to the top to give contributors a better context of our progress.
For the component to-do list, I noted them down in alphabetical order, but I'm sure you have a different order in mind with the components' priority, so please help me to adjust it. If the list misses anything please help add them in as well.
41 remaining items
hamzawaleed0102 commentedon Sep 22, 2021
Thanks @ahmadabdolsaheb
Let me go through the docs and get back to you on this, most probably with a draft PR.
hamzawaleed0102 commentedon Oct 4, 2021
@ahmadabdolsaheb I enjoyed working on TS configuration for UI components library. I'm up for any other ticket.
RJZauner commentedon Oct 6, 2021
Hey! I would love to help. I enjoy working with TS and love working on frontend components. Where can I help?
ahmaxed commentedon Oct 6, 2021
@hamzawaleed0102, @RJamesMaier thank you for your interest.
Once #43616 is reviewed and merged, we can start developing components and swapping them in the learn platform.
Feel free to start working on a component that is listed in the issue description.
You could gather the requirements by reviewing how each component is being used, what props are being passed, and how each DOM element is being rendered.
Additionally make sure to review a11y best practices for each element and write tests accordingly.
Please document the process of your research and component creation in your pr so we could add it to the issue for onboarding new contributors.
RJZauner commentedon Oct 6, 2021
Awesome thank you!
huyenltnguyen commentedon Oct 10, 2021
Hey friends 👋
First of all, I'm sorry for being absent for a very long time and blocking the work. Covid hit and left me with mental bumps and bruises. I will need some time to get the balance back, but will try to be more responsive here as well as in the chat.
As @ahmadabdolsaheb mentioned, we will need to gather the specs for each component before implementing them. The requirements will be slightly different depending on the complexity of the components, but I think the following questions need to be answered overall:
required,disabled,aria-describedby,...)inputwhen it is marked required, or is disabled? - This is extended from the question above, but the attributes are not always present unless the component is in a specific state.I think I have more to add, but I will need to sit down to have a more comprehensive guide (this is part of the documentation task that I keep failing to commit). I know this is quite overwhelming, especially the accessibility part, but I believe this is a right thing to do. Having a11y in mind now will enables us to have better implementation approaches in the beginning, rather than trying to shift the implementation later as a11y being an after-thought. We don't need to get it right the first time, but just try to take into consideration. Btw, even Material UI can't claim that their components are 100% accessible (see this PR).
Also, I was thinking about opening an issue for each component, so that we can keep the discussion in one place, but it's up to you guys 🙂.
Feel free to send PRs out if you think they are ready, and perhaps /cc me in there for visibility. I will try, but I don't think I can review them in a timely fashion, and I know it is Hacktoberfest, so I don't want to ruin it for you. I'll trust the core maintainers with the decision to merge the changes. I would rather see some movements in the component library rather than leaving it stale.
Looking forwards to your contributions. Stay safe, stay healthy, and happy coding!
There are a lot of component libraries out there for us to use as references, I'm linking some that I find helpful for me when I need to look for component guidelines and a11y best practices:
One interesting thing I recently found is that there are a lot of governments that have their own design system page, and they are open source ❤️ (and tax money well spent!):
sitek94 commentedon Oct 13, 2021
Hey everyone! 👋
I've been working a bit on alert component, and I've just opened a draft PR (#43835). I would really appreciate your feedback!
RJZauner commentedon Oct 13, 2021
Hi everyone!
I got my local setup for FCC working.
Just wanted to let you know that I will be looking at building out the toggle buttons.
jtxz commentedon Oct 19, 2021
I have experience building UI component libraries and would like to contribute. Are there any mocks for these components?
ahmaxed commentedon Oct 19, 2021
@JoeTurnerIO, Thanks for your interest. The components' design and functionality should resemble the components that are used in the learn codebase. Here is an example:
freeCodeCamp/client/src/components/settings/Certification.js
Lines 1 to 6 in d161998
adsingh14 commentedon Oct 30, 2021
I would like to contribute.
Ismailtlem commentedon Dec 26, 2021
Hi guys
I am interested in taking part in this effort, I've made a PR for the image component. Any feedback would be greatly appreciated
adsingh14 commentedon Nov 11, 2022
Donations dialog box(attached below) UI need to redesign.

Contribution: Yes