Bootstrap: Skinning/Customizing Appearance
Master Bootstrap customization for responsive web design
Bootstrap Customization Core Concepts
Skinning Fundamentals
Learn how to override Bootstrap's default styles while maintaining responsive functionality. Understand the cascade and specificity rules for effective customization.
Media Query Control
Create custom breakpoints beyond Bootstrap's defaults. Fine-tune responsive behavior for specific content requirements and screen sizes.
Component Enhancement
Add visual polish with icon fonts, fixed navigation, and theme variations. Integrate Bootstrap's optional components seamlessly.
Custom Media Query Implementation
Identify Breakpoint Needs
Bootstrap's smallest breakpoint is 768px, but content may need adjustments at different screen sizes. Analyze your layout to determine custom breakpoint requirements.
Create Custom Media Query
Add @media (max-width: 599px) rule to target screens smaller than Bootstrap's default breakpoints. Choose values based on content testing.
Override Specificity
Use !important declarations when necessary to override Bootstrap's built-in styles that use important declarations.
When Bootstrap uses !important in CSS rules, your more specific selectors won't override them. You must add !important to your custom CSS to force the override.
Default vs Theme Styling
| Feature | Default Bootstrap | Optional Theme |
|---|---|---|
| Visual Style | Flat, minimalist | 3D gradients, highlights |
| Customization Ease | Easier to override | More styles to override |
| File Size | Smaller | Additional CSS file |
| Components Affected | Basic styling | Navbar, buttons, wells |
Fixed Navbar Implementation
Apply Navbar Classes
Change navbar-default to navbar-inverse for dark styling, add navbar-fixed-top for fixed positioning at the top of the viewport.
Adjust Body Padding
Add 80px top padding to body element to prevent navbar from covering content. The navbar is 50px tall plus 30px spacing.
Align Content
Wrap navbar content in container div to align with page content grid system across different breakpoints.
Fixed positioning removes elements from document flow. Always adjust body padding to compensate for covered content when using navbar-fixed-top.
Icon Font Implementation Techniques
Glyphicon Classes
Use span elements with glyphicon classes to add icons. Bootstrap includes shopping cart, comment, and many other common icons built-in.
CSS Font Styling
Icons behave like text and can be styled with font-size, color, line-height, and positioning properties for perfect visual alignment.
Icon Implementation Best Practices
Use margin or padding to prevent crowded appearance
Larger icons can affect line spacing and push text off baseline
Small top adjustments can improve visual centering
Icons should maintain proper spacing in responsive layouts
Dark Theme Implementation Process
Background Foundation
Apply dark base color (#222) and diagonal gradient pattern using repeating-linear-gradient
Content Contrast
Adjust horizontal rules, wells, and text colors to maintain readability on dark background
Interactive Elements
Customize button styles and hover states to match dark theme aesthetic while preserving usability
When implementing a dark theme, systematically update all UI components including borders, backgrounds, text colors, and hover states to maintain visual coherence across the entire interface.
Key Takeaways
