{"id":24809519,"url":"https://github.com/yashi-singh-9/pricing-component-with-toggle","last_synced_at":"2026-04-12T00:08:47.367Z","repository":{"id":274903980,"uuid":"924445620","full_name":"Yashi-Singh-9/Pricing-Component-with-Toggle","owner":"Yashi-Singh-9","description":"The Pricing Component with Toggle is a responsive pricing table that lets users switch between monthly and annual plans. Built with HTML, CSS (LESS), and JavaScript, it updates prices dynamically and ensures accessibility with keyboard support.","archived":false,"fork":false,"pushed_at":"2025-01-30T02:47:49.000Z","size":0,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-30T03:24:26.406Z","etag":null,"topics":["bootstrap","css","frontend","frontend-mentor","html","javascript","less","less-preprocessor"],"latest_commit_sha":null,"homepage":"https://yashi-singh-9.github.io/Pricing-Component-with-Toggle/","language":"Less","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Yashi-Singh-9.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-30T02:32:41.000Z","updated_at":"2025-01-30T02:50:24.000Z","dependencies_parsed_at":"2025-01-30T03:34:35.014Z","dependency_job_id":null,"html_url":"https://github.com/Yashi-Singh-9/Pricing-Component-with-Toggle","commit_stats":null,"previous_names":["yashi-singh-9/pricing-component-with-toggle"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yashi-Singh-9%2FPricing-Component-with-Toggle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yashi-Singh-9%2FPricing-Component-with-Toggle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yashi-Singh-9%2FPricing-Component-with-Toggle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yashi-Singh-9%2FPricing-Component-with-Toggle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Yashi-Singh-9","download_url":"https://codeload.github.com/Yashi-Singh-9/Pricing-Component-with-Toggle/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245458710,"owners_count":20618697,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bootstrap","css","frontend","frontend-mentor","html","javascript","less","less-preprocessor"],"created_at":"2025-01-30T11:14:29.040Z","updated_at":"2025-10-28T03:02:27.500Z","avatar_url":"https://github.com/Yashi-Singh-9.png","language":"Less","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Frontend Mentor - Pricing Component with Toggle Solution\n\nThis is a solution to the [Pricing component with toggle challenge on Frontend Mentor](https://www.frontendmentor.io/challenges/pricing-component-with-toggle-8vPwRMIC). Frontend Mentor challenges help you improve your coding skills by building realistic projects.\n\n## Table of contents\n\n- [Overview](#overview)\n  - [The challenge](#the-challenge)\n  - [Screenshot](#screenshot)\n  - [Links](#links)\n- [My process](#my-process)\n  - [Built with](#built-with)\n  - [What I learned](#what-i-learned)\n  - [Continued development](#continued-development)\n  - [Useful resources](#useful-resources)\n- [Getting Started](#getting-started)\n  - [Installing LESS](#installing-less)\n  - [Compiling LESS](#compiling-less)\n- [Author](#author)\n- [Acknowledgments](#acknowledgments)\n\n---\n\n## Overview\n\n### The challenge\n\nUsers should be able to:\n\n- View the optimal layout for the component depending on their device's screen size.\n- Toggle between monthly and annual pricing using both mouse and keyboard.\n- **Bonus**: Complete the challenge using semantic HTML, CSS, LESS, and vanilla JavaScript.\n\n### Screenshot\n\n**Desktop Design**\n\n![Pricing Component with Toggle](design/desktop-design.png)\n\n**Mobile Design**\n\n\u003cimg src=\"design/mobile-design.png\" height=\"750\"\u003e\n\n### Links\n\n- [Solution](https://www.frontendmentor.io/solutions/pricing-component-with-toggle-ljLC5NpBbI)\n- [Live Site](https://yashi-singh-9.github.io/Pricing-Component-with-Toggle/)\n\n---\n\n## My process\n\n### Built with\n\n- Semantic HTML5 markup\n- Bootstrap 5 for layout and styling\n- LESS preprocessor for modular and dynamic styling\n- Vanilla JavaScript for interactivity\n- Mobile-first workflow\n\n---\n\n### What I learned\n\nThis project reinforced my knowledge of:\n\n1. **LESS Preprocessor**: Using variables, mixins, and nesting to write modular, maintainable, and dynamic CSS.\n2. **JavaScript for Accessibility**:\n   - Implementing keyboard-accessible features by toggling `aria-checked` for the toggle switch.\n   - Writing dynamic scripts to change pricing values.\n3. **Bootstrap Customization**: Integrating Bootstrap with custom styles and overrides.\n4. **Responsive Design**:\n   - Designing for mobile-first.\n   - Adjusting layouts using media queries.\n\nExample of the LESS code for the toggle switch:\n\n```less\n.toggle {\n  background: linear-gradient(to bottom, @linear-gradient-1, @linear-gradient-2);\n  \u0026:hover {\n    background: linear-gradient(to bottom, lighten(@linear-gradient-1, 10%), lighten(@linear-gradient-2, 10%));\n  }\n  \u0026.active {\n    \u0026:before {\n      transform: translateX(-40px);\n    }\n  }\n}\n```\n\n---\n\n### Continued development\n\nIn future projects, I aim to focus on:\n\n1. Improving the accessibility of dynamic components (like this toggle).\n2. Deepening my understanding of advanced LESS features, such as conditionals and loops.\n3. Experimenting with utility-first CSS frameworks like Tailwind CSS alongside preprocessors.\n\n---\n\n### Useful resources\n\n1. [LESS Documentation](https://lesscss.org/) - The official LESS documentation was invaluable for setting up and understanding advanced features.\n2. [Bootstrap 5 Documentation](https://getbootstrap.com/docs/5.3/getting-started/introduction/) - For layout and component customizations.\n3. [MDN Web Docs](https://developer.mozilla.org/) - For JavaScript functionality, especially ARIA attributes.\n\n---\n\n## Getting Started\n\n### Installing LESS\n\nLESS is a CSS preprocessor that extends CSS with dynamic behavior such as variables, nesting, mixins, and more. To use LESS in your project:\n\n1. Ensure you have Node.js and npm installed. If not, download and install them from [Node.js](https://nodejs.org/).\n2. Install LESS globally by running:\n   ```bash\n   npm install -g less\n   ```\n\n### Compiling LESS\n\nTo compile the `style.less` file into CSS:\n\n1. Run the following command:\n   ```bash\n   lessc style.less style.css\n   ```\n2. Include the compiled `style.css` file in your HTML, as shown in the code.\n\nYou can also use a LESS watcher tool like `less-watch-compiler` for live compilation during development:\n   ```bash\n   npm install -g less-watch-compiler\n   less-watch-compiler ./ ./ style.less\n   ```\n\n---\n\n## Author\n\n- LinkedIn - [Yashi Singh](https://www.linkedin.com/in/yashi-singh-b4143a246)\n- Frontend Mentor - [@Yashi-Singh-9](https://www.frontendmentor.io/profile/Yashi-Singh-9)\n\n---\n\n## Acknowledgments\n\nBig thanks to [Frontend Mentor](https://www.frontendmentor.io) for creating such realistic challenges. This project was a fantastic way to refine my skills in LESS and JavaScript. \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyashi-singh-9%2Fpricing-component-with-toggle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyashi-singh-9%2Fpricing-component-with-toggle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyashi-singh-9%2Fpricing-component-with-toggle/lists"}