Overview
SoundWave implements a Spotify-inspired dark theme design system using vanilla CSS. The styling architecture emphasizes consistency, accessibility, and responsive design across different viewport sizes.Color System
Primary Color Palette
The application uses a carefully curated color scheme that matches Spotify’s brand identity:#1db954Usage: Buttons, links, interactive elements, headingsReference: styles.css:10, styles.css:55#1ed760Usage: Button hover states, interactive feedbackReference: styles.css:62, styles.css:129#14833bUsage: Button pressed state (in index.html inline styles)Reference: index.html:60#121212Usage: Main page background, player backgroundReference: styles.css:3, index.html:11#282828Usage: Input fields, suggestion containers, content cardsReference: styles.css:22, styles.css:38, styles.css:66#383838Usage: Hover states for suggestions and linksReference: styles.css:46, styles.css:101#ffffffUsage: Primary text, button textReference: styles.css:4, styles.css:23#b3b3b3Usage: Placeholder text, secondary informationReference: styles.css:28, styles.css:136Color Usage Matrix
Typography
Font Stack
styles.css:2
The Spotify-themed pages (index.html, index3.html) use Roboto from Google Fonts:Reference:
index.html:7, index.html:10Font Sizes
16pxUsage: Input fields, buttons, body textReference: styles.css:21, styles.css:5414pxUsage: Group information, metadataReference: styles.css:135Component Styles
Input Fields
styles.css:15-25, styles.css:27-29
25px creates pill-shaped inputs12px provides comfortable touch targetsButtons
styles.css:49-59, styles.css:61-63
Suggestion Items
styles.css:35-43, styles.css:45-47
The
transition: background-color 0.3s creates smooth hover animations. This same pattern is used for all interactive elements.Content Containers
styles.css:65-71, styles.css:73-76, styles.css:78-80
Audio Player
styles.css:82-87
The native
<audio> controls inherit the dark background, creating visual consistency with the rest of the interface.Source Links Container
styles.css:89-96, styles.css:98-106, styles.css:108-110
The container is hidden by default and shown via JavaScript when audio links are available:
Layout Patterns
Page Structure
styles.css:1-7
margin: 0 removes default browser margins, while padding: 20px creates consistent page gutters.Heading Styles
styles.css:9-13
Group Navigation
styles.css:112-116, styles.css:132-137
Responsive Design
Media Query Breakpoint
styles.css:139-149
768px (tablet and above)Full width (100%) for inputs and content
Centered column:
- Inputs: 50% width, centered with 25% left margin
- Content: 70% width, centered with 15% left margin
Inline Responsive Styles
The Spotify-themed pages include additional inline media queries:index.html:64-68
index3.html:61-66
This reduces the Spotify embed height on mobile to save vertical space.
Animation and Transitions
Hover Transitions
All interactive elements use consistent 0.3s transitions:.suggestion(styles.css:42)#search-button(styles.css:58).audio-link(styles.css:105).group-separator button(styles.css:125)
Text Decorations
Hover effects for links:index.html:35-37, styles.css:78-80
Accessibility Considerations
Focus Management
Color Contrast
The dark theme provides excellent contrast ratios:Primary Text
White on dark background (#ffffff on #121212)Contrast Ratio: 15.3:1 (WCAG AAA)
Secondary Text
Gray on dark background (#b3b3b3 on #121212)Contrast Ratio: 8.6:1 (WCAG AAA)
Green Accent
Green on dark background (#1db954 on #121212)Contrast Ratio: 5.2:1 (WCAG AA)
Button Text
White on green (#ffffff on #1db954)Contrast Ratio: 2.9:1 (WCAG AA Large)
Cursor Feedback
Styling Best Practices
1. Border Radius Consistency
Pill Shapes (25px):- Input fields
- Buttons
- Navigation buttons
- Content containers
- Suggestion items
- Audio player
- Spotify iframe (index.html:84)
2. Spacing System
20px for content containers12px for input fields and buttons10px for list items and suggestions20px for vertical spacing between major sections10px for spacing between related items5px for tight grouping (suggestion items)3. Layering System
The application uses background color depth to create visual hierarchy:Inline Styling Patterns
Some pages use inline styles for quick prototyping:index.html Inline Styles
index.html:9-18
The inline styles duplicate functionality from styles.css but add page-specific constraints like the 1024px width.
index2.html Inline Styles
index2.html:8-58
Theming Recommendations
CSS Custom Properties
For better maintainability, consider converting to CSS variables:Dark/Light Theme Toggle
With CSS variables, implementing theme switching becomes straightforward:Component Library Patterns
Reusable Button Class
Card Component Pattern
Performance Considerations
CSS Loading Strategy
- External Stylesheet: styles.css is linked for global styles
- Inline Critical CSS: Page-specific styles inlined to reduce render blocking
- Font Loading: Google Fonts loaded asynchronously with
display=swap
Transition Performance
All transitions usebackground-color which is GPU-accelerated:
Avoid animating properties like
width, height, or margin as they trigger layout recalculations. Stick to transform, opacity, and color properties for best performance.Browser Compatibility
The styling uses standard CSS properties with broad support:- Flexbox: Supported in all modern browsers
- Border Radius: Supported in all modern browsers
- Transitions: Supported in all modern browsers
- ::placeholder: Supported in all modern browsers
Next Steps
Architecture
Explore the overall application structure and component organization
API Integration
Learn about external API usage and data fetching patterns