feat (frontend): add tailwind, shadcn & fonts#53
Conversation
frontend/package.json
Outdated
| "@types/react": "^19.1.13", | ||
| "@types/react-dom": "^19.1.9", | ||
| "@vitejs/plugin-react": "^5.0.3", | ||
| "autoprefixer": "^10.4.21", |
There was a problem hiding this comment.
Tailwind doesn't need autoprefixer since v4.
If you are writing custom CSS and want autoprefixer to run on that, then you would have to remove @tailwindcss/vite, use @tailwindcss/postcss and add a postcss.config.js file. As it currently stands, postcss and autoprefixer do nothing.
frontend/package.json
Outdated
| "eslint-plugin-react-hooks": "^5.2.0", | ||
| "eslint-plugin-react-refresh": "^0.4.20", | ||
| "globals": "^16.4.0", | ||
| "postcss": "^8.5.6", |
There was a problem hiding this comment.
Because you do not need autoprefixer, and tailwind is used as a Vite plugin, you will not need this package either.
There was a problem hiding this comment.
Got it, thank you!
had autoprefixer and postcss in the package.json file, but forgot that tailwind v4 doesn't need that since we also don't need the postcss and tailwind.config files anymore
liangricky7
left a comment
There was a problem hiding this comment.
Looks good, except just move your changes to App.tsx to a different file; I'll go in and make a react router in the next hour that can link to whichever page you want to have your test page on
I added the foundation for our custom fonts and colors in a new styles folder in the src folder, and tailored it to the design principles of the member portal in the index.css file.
There was a problem hiding this comment.
- take the styles folder out of assets; it should be its own folder
- paste all of the content in App.tsx into some file in the pages folder since we need different content to be in App.tsx
- in fonts.css, the Sora Font Family isn't properly imported; the font-family is "Manrope" for most, and the src is just not correct
- We don't need static fonts if we have dynamic fonts; you can delete both static files
I added the input shadcn component and fixed the bugs from the previous pull request.
liangricky7
left a comment
There was a problem hiding this comment.
Are we going to use the dynamic fonts? if not, we can just delete them
If we are using static, for Sora, we only need the Regular and Bold, and for Manrope, Bold and ExtraBold
I put them there just as options depending on design elements. We can delete them of course, but I just added them for possible integration. I only used Manrope Bold and SemiBold and Sora Regular on my own pages, but wasn't sure if we would decide differently on designs in the future. |
…or typography I took the fonts I uploaded from Google and deleted the ones we primarily aren't going to use. I then redefined them in fonts.css with their corresponding weights based on the figma design(s) so then I could create their specific classes and variants. I lastly moved the specific styles for the fonts into a separate file called typography.css and imported it into index.css.
Changed oklch value to match color palette
| @font-face { | ||
| font-family: "Sora"; | ||
| src: url("/src/assets/fonts/Sora/static/Sora-Medium.ttf"); | ||
| font-weight: 600; |
There was a problem hiding this comment.
Bold fonts should have a font weight of 700. If intending 600, use semibold.
https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-weight#common_weight_name_mapping
There was a problem hiding this comment.
Ricky told me to use 600 for all of the bold fonts.
There was a problem hiding this comment.
Should configure this in @layer base instead of applying to h1, h2, h3 directly.
The utility classes (.h1, .h2, .h3) should use @utility.
https://tailwindcss.com/docs/adding-custom-styles#adding-base-styles
https://tailwindcss.com/docs/adding-custom-styles#adding-custom-utilities
There was a problem hiding this comment.
Mutually exclusive with static fonts.
There was a problem hiding this comment.
Mutually exclusive with static fonts.
Deleted sora bold and re-added sora semibold to fit the desired 600 font weight
Created tailwindcss configuration and added shadcn components such as a button and card