|
1 | | -# QR Code | Minimalist UI Component 📱 |
2 | | -A high-fidelity, responsive QR code component built with a focus on layout precision and modular styling. This project demonstrates a "clean-code" approach to simple UI elements, utilising SCSS and Semantic HTML5. |
| 1 | +QR Code | Minimalist UI Component 📱 |
| 2 | +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. |
3 | 3 |
|
4 | 4 | ## 📸 Preview |
5 | 5 |
|
6 | 6 |  |
7 | 7 |
|
8 | 8 | ## 🚀 Technical Highlights |
9 | 9 |
|
| 10 | +- **Theming Engine:** Custom TypeScript implementation to detect and toggle system/user theme preferences. |
10 | 11 | - **Markup Architecture:** Pure HTML5 using semantic elements for optimal document structure. |
11 | | -- **Styling Architecture:** Modular SCSS following the BEM (Block Element Modifier) methodology to ensure encapsulated, reusable styles. |
12 | | -- **Layout Engine:** CSS Flexbox and Grid used in tandem to achieve perfect centring and internal padding. |
13 | | -- **Responsive Design:** Mobile-first workflow using relative units (rem, px) to maintain visual balance across all screen sizes. |
14 | | -- **Asset Optimisation:** High-resolution rendering and optimised font loading for a sharp, professional finish. |
| 12 | +- **Styling Architecture:** Modular SCSS following the BEM (Block Element Modifier) methodology. |
| 13 | +- **Modern CSS:** Utilises CSS Custom Properties (Variables) and the light-dark() strategy for seamless theme transitions. |
| 14 | +- **Responsive Design:** Mobile-first workflow using relative units (rem) to maintain visual balance. |
15 | 15 |
|
16 | 16 | ## 🏗️ Architectural Overview |
17 | 17 |
|
18 | | -### 1. Structural Precision |
| 18 | +### 1. TypeScript Theme Management |
19 | 19 |
|
20 | | -While the design is minimalist, achieving a "pixel-perfect" match requires a disciplined approach to the box model: |
21 | | -- **Card Encapsulation:** The component is built as a self-contained block, allowing it to be easily ported into larger dashboards or landing pages. |
22 | | -- **Flexbox Alignment:** Utilised a dual-axis centring strategy to ensure the card remains perfectly anchored in the viewport regardless of device orientation. |
23 | | -- **Typography System:** Implemented a hierarchical font system with specific attention to letter-spacing and line-height for maximum legibility. |
| 20 | +To go beyond static HTML/CSS, I implemented a logical layer to handle user preferences: |
| 21 | +- **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. |
| 22 | +- **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. |
| 23 | +- **Type Safety:** Leverages TypeScript's strict typing to ensure theme tokens are managed without runtime errors. |
24 | 24 |
|
25 | 25 | ### 2. Scalable Style System (BEM + SCSS) |
26 | 26 |
|
27 | | -Following the "Product Suite" standard, the styles are organised for long-term maintainability: |
28 | | -- **BEM Methodology:** Ensures that classes like `.qr-card__image` and `.qr-card__title` remain unique and protected from global style leakage. |
29 | | -- **Variables & Mixins:** Leveraged SCSS variables for the color palette and spacing scale, allowing for instant global theme updates. |
30 | | -- **Performance:** Zero-dependency CSS ensures lightning-fast paint times and a perfect Core Web Vitals score. |
| 27 | +The visual architecture is built for maintainability: |
| 28 | +- **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. |
| 29 | +- **BEM Methodology:** Ensures that classes remain unique and protected from global style leakage. |
| 30 | +- **Performance:** High-performance theme switching with zero layout shift (CLS). |
31 | 31 |
|
32 | | -### 3. Accessible Implementation |
| 32 | +### 3. Structural Precision |
33 | 33 |
|
34 | | -- **Alt Text Optimisation:** Descriptive metadata for the QR image ensures that screen reader users understand the context of the component. |
35 | | -- **Logical Flow:** The heading structure is optimised for SEO and assistive technology navigation. |
| 34 | +- **Flexbox Alignment:** Utilised a dual-axis centring strategy to ensure the card remains perfectly anchored. |
| 35 | +- **Typography System:** Implemented a hierarchical font system with specific attention to letter-spacing and contrast ratios (WCAG compliant) in both Light and Dark modes. |
36 | 36 |
|
37 | 37 | ## 🛠️ Built With |
38 | 38 |
|
|
0 commit comments