Skip to content

A pixel-perfect, responsive QR code component built with semantic HTML5 and modular SCSS (BEM). Optimized for performance, accessibility, and high-fidelity display.

License

Notifications You must be signed in to change notification settings

seanbuckle/qr-code-component

Repository files navigation

QR Code | Minimalist UI Component 📱

A high-fidelity, responsive QR code component featuring System-Aware Dark Mode integration. This project demonstrates a "clean-code" approach to UI elements, utilising TypeScript for theme logic and SCSS for modular styling.

📸 Preview

Minimalist QR code component featuring a centered blue image and clean typography.

🚀 Technical Highlights

  • Theming Engine: Custom TypeScript implementation to detect and toggle system/user theme preferences.
  • Markup Architecture: Pure HTML5 using semantic elements for optimal document structure.
  • Styling Architecture: Modular SCSS following the BEM (Block Element Modifier) methodology.
  • Modern CSS: Utilises CSS Custom Properties (Variables) and the light-dark() strategy for seamless theme transitions.
  • Responsive Design: Mobile-first workflow using relative units (rem) to maintain visual balance.

🏗️ Architectural Overview

1. TypeScript Theme Management

To go beyond static HTML/CSS, I implemented a logical layer to handle user preferences:

  • Preference Detection: Uses TypeScript to interface with the window.matchMedia('(prefers-color-scheme: dark)') API, ensuring the UI respects the user's OS settings on load.
  • State Persistence: (Optional/If applicable) The engine synchronises the theme state across the DOM, applying a data-attribute or class to the root element for consistent styling.
  • Type Safety: Leverages TypeScript's strict typing to ensure theme tokens are managed without runtime errors.

2. Scalable Style System (BEM + SCSS)

The visual architecture is built for maintainability:

  • Thematic Variables: Defined a robust set of CSS Custom Properties that swap dynamically based on the theme state, eliminating the need for redundant CSS blocks.
  • BEM Methodology: Ensures that classes remain unique and protected from global style leakage.
  • Performance: High-performance theme switching with zero layout shift (CLS).

3. Structural Precision

  • Flexbox Alignment: Utilised a dual-axis centring strategy to ensure the card remains perfectly anchored.
  • Typography System: Implemented a hierarchical font system with specific attention to letter-spacing and contrast ratios (WCAG compliant) in both Light and Dark modes.

🛠️ Built With

SASS HTML5

🔗 Live Implementation

🏁 Installation & Development

To run this project locally:

  1. Clone the repository:
    git clone https://github.com/seanbuckle/qr-code-component.git
  2. Navigate to the directory:
    cd qr-code-component
  3. Open the project: Simply open index.html in your preferred browser.

👨‍💻 Author

Sean Buckle

Frontend Mentor Profile

LinkedIn

📜 License

This project is licensed under the MIT License - see the LICENSE file for details.


Note: This project was built as a solution to a Frontend Mentor challenge.

About

A pixel-perfect, responsive QR code component built with semantic HTML5 and modular SCSS (BEM). Optimized for performance, accessibility, and high-fidelity display.

Topics

Resources

License

Stars

Watchers

Forks