HTML Components built using TailwindCSS
- Usage
- How it works
- Naming Convention
- How to add new component
- Contribution
- License
- Contact Information
├── src/
├──components contains components respective folder with markup and styles
├──COMPONENT A components folder where all components with their respective folders are present
├──index.html component A markup file
├──style.scss component A style file (Optional)
├──preview.md component screenshot preview on folder access
├──preview.png component design preview image
├──COMPONENT B
├──index.html
├──style.scss
├──COMPONENT B VARIATION
├──index.html
├──style.scss
....
....
....
....
├──COMPONENT X
├──index.html
├──style.scss
├──style.scss Main page styles
├──index.html Main page of the website
├── dist/ Optimized components with respective folders (Available after `yarn build`)
yarn installyarn serveNote: The local dev server can be accessed through port
8989i.e.,localhost:8989and corresponding components by accessing folder/file aslocalhost:8989/components/COMPONENT_FOLDER/index.htmleg:localhost:8989/components/alert/index.html
yarn build-
Each component is present in its respective folder eg:
components/COMPONENT1,components/COMPONENT2, Eg:components/cardetc -
SCSS file is added and linked directly within HTML using
linkattribute which will be compiled by parcel which as defaulttailwindcssstyles.<link rel="stylesheet" href="style.scss">
Note: Tailwind Styles are required for each respective component style (SCSS) file within which you can use
@applydirective to extract tw classes to respective component classes@tailwind base; @tailwind components; @tailwind utilities; // Other styles here using @apply for extracting tailwind classes to each class -
Once the command
yarn buildis run, the output files will be present ondistfolder with the same component structure.
- Each Component should follow the naming as
SERIAL_NUMBER-COMPONENT_NAME. Eg:01-alert,'02-notifications' etc - When there is a variation of the component such as
alertwe can name as01-alert-variant2etc - The serial number must follow along with category. For Example currently no card component is present, in that case
01-card. Each component numbering starts from01followed by category
- Go to
src/componentsdirectory. Duplicate thetemplatefolder into components with the component name. Follow Naming Convention for naming the folder - Update the title in
index.htmland contents within<!-- Component start --> <!-- Component End -->lines. - Take a Screenshot of the result and replace the
preview.pngwithin the component folder. - Run
yarn serveto play with changes
Glad to see you are interested in improving this repository. Please read the contributing guidelines here
By contributing, you agree that your contributions will be licensed under its MIT License.
- Email: manjumjng2@gmail.com
- Twitter: https://twitter.com/manjumjn
- Website: https://manjumjn.com