FNB App Academy Notes 21 May 2025
Today’s Path Forward: Enterprise CSS and Scalable Web Architecture @ FNB
1. The CSS Mindset in Modern Product Engineering
At this stage, you’re no longer writing “style sheets.” You’re crafting a design system, serving it to real-time web platforms, and integrating it with:
Business-critical workflows
Regulatory compliance
Accessibility standards (WCAG 2.1+)
Cross-platform mobile and desktop frameworks
CI/CD and observability pipelines
The skill now lies in architecting maintainable styling layers, supporting performance under load, and eliminating ambiguity between design, code, and product.
From Art to Engineering
Design is no longer subjective.
Your CSS must be deterministic: predictable, testable, tokenized.
A failed alignment or font color isn’t a “bug” — it’s a contract violation with brand and compliance teams.
2. Deep Integration with Enterprise Design Systems
Tokenized Theming and Platform-Agnostic Styling
Design tokens are the single source of truth for style definitions — not raw hex codes or font names sprinkled in CSS.
Implementation Strategy
Use tools like Style Dictionary or Tokens Studio to output multiple format layers from a single .json token map:
SCSSfor the frontend web teamsXMLfor AndroidColors.swiftfor iOSJSONschema for internal tooling (like chart renderers)
These are not just variables. They’re contracts between design and code, and must be validated by automated pipelines (covered in section 6).
3. Componentization: CSS in JS & Encapsulation
In a React or Angular environment, CSS-in-JS enables:
Scoped styling via component boundaries
Dynamic themes via context providers
Elimination of naming collisions
Runtime styling changes (dark/light mode, language-based direction, etc.)
Example (React + Styled Components)
✅ Tip: Use design tokens inside your JS theme file, not hardcoded styles.
4. Workflow & Source Control in Styling Teams
Branching Patterns
Use Git feature branching consistently:
feature/ui-dashboard-summaryfix/css-header-heightchore/style-token-sync
All feature branches should follow these best practices:
Enforce CSS linting in CI (e.g., Stylelint, Prettier).
Run visual regression tests automatically on PRs (via Percy or Chromatic).
Tag PRs with
@design-reviewedwhen matching the latest Figma design.
5. Design QA Pipeline: From Design to Production
Every visual element must undergo:
Design Handoff QA
Review against Figma
Validate spacing, alignment, typography
Accessibility Review
Use aXe DevTools, Lighthouse, or Tota11y
Focus on keyboard navigation, focus rings, tab order, and ARIA roles
Responsive Testing
Use BrowserStack or real devices
Test breakpoints: 320px (mobile), 768px (tablet), 1280px (desktop), 1440+ (HD displays)
Visual Regression Testing
Snapshots of UI components saved and diffed in CI/CD pipelines
Use tools like Chromatic for Storybook integration or Percy for full-page diffs
6. Enforcing Consistency at Scale
To maintain a unified visual language:
Source of Truth Enforcement
Use CI hooks to validate token usage.
Run scheduled style audits (monthly) to prune unused classes.
Track bundle bloat via Source Map Explorer or Webpack Analyzer.
️ Tooling You Should Know
| Tool | Purpose |
|---|---|
| Stylelint | CSS Linter |
| PostCSS | Polyfills and transforms |
| PurgeCSS | Removes unused styles |
| SassDoc | Auto-docs for style modules |
| Storybook | Visualize components with styles |
| Chromatic | UI testing + snapshots |
| Source Map Explorer | Visualize CSS weight in bundle |
7. Theming Architecture and White-Labeling
In enterprise apps like FNB that may have co-branded variants, design tokens allow theme switching via:
Dynamically switch via JS:
This allows runtime customization for:
Different banks (FNB, RMB, WesBank, etc.)
Internal-only admin dashboards
Premium vs Standard users
8. Enterprise Dark Mode
⚙️ How to Implement
Use prefers-color-scheme media query:
Add manual toggle override in JavaScript:
Always test contrast ratios using tools like WebAIM Contrast Checker
✅ Audit Criteria
Ensure color combinations meet WCAG AA or AAA standards
Do not invert charts or branded logos without explicit rules
Handle system preference gracefully (especially on macOS and Android)
9. Secure Styling in Regulated Environments
Even though CSS isn’t executable, styling misuse can expose security vulnerabilities.
❌ Bad Practice
Do not expose sensitive roles in class names
Never trust user input when generating classes or inline styles
✅ Secure Patterns
Sanitize all dynamic class usage
Avoid inline styles unless sanitized
Store style tokens server-side if needed for consistent roles
10. Performance Optimization in Large-Scale Apps
In FNB’s context, performance is non-negotiable:
Budget: CSS < 100KB uncompressed
Lazy load non-critical styles
Use dynamic imports:
Critical CSS Strategy
Inline only above-the-fold CSS in index.html:
Preload the main stylesheet:
Tree-shake unused classes with:
PurgeCSSViteorWebpackCSS minimizersTailwind’s
contentscanner
11. Responsive & Accessible Components
In apps like FNB, users range from 18 to 80+ — and accessibility is a legal requirement.
Dashboard Card Requirements
Collapse on small screens
Use keyboard navigable buttons
Voice-over readable labels (
aria-label)High-contrast themes for visually impaired
Secure Input Field
Add focus-visible style:
12. Establishing Visual Culture in Teams
In mature product teams, developers aren’t just coders — you’re visual engineers.
Team Guidelines
Pair design sign-offs with PR reviews
Keep a shared Storybook environment for all styled components
Conduct biweekly style retrospectives to review:
Token drift
Component consistency
User feedback on accessibility
Document component decisions (Notion, Confluence)
✅ Recap & What To Do Next
You’ve gone far beyond raw CSS syntax. You’re now operating in the real-world:
Token-driven design systems
Automated testing and linting
Figma-to-production pipelines
Style security and privacy constraints
Enterprise white-label theming
Global accessibility coverage
Next Action Items for You
Contribute a real component to the FNB design system (start with a card or input group).
Run a style audit on your last module — find and eliminate dead CSS.
Create a demo dark/light theme switcher with persistent state (
localStorage).Write documentation for any layout or component you own — diagrams welcome.
Improve the CI pipeline to include
Stylelint,Percy, orSource Map Explorer.
Final Words
CSS is no longer “just styling.” It’s a product contract. It defines user experience, accessibility, trust, and consistency. In a regulated space like FNB, every pixel matters.
Let your code reflect:
Design rigor
Performance discipline
Security mindfulness
Accessibility compassion
Engineering elegance
You are now a full-spectrum UI engineer. Welcome to the next level.
