From First Selector to Production-Ready Stylesheets
Introduction
Chapter 1: What Is CSS and How Does It Work?
- The Role of CSS in Web Pages
- How Browsers Read and Apply Stylesheets
- Syntax: Rules, Selectors, Declarations, Properties, Values
- Attaching CSS: Inline, Internal, External Stylesheets
- The Cascade: Order, Specificity, and Importance
Chapter 2: Selectors: Targeting Elements with Precision
- Type, Class, ID, and Universal Selectors
- Combinators: Descendant, Child, Adjacent, General Sibling
- Attribute Selectors
- Pseudo-Classes: State-Based Selection
- Pseudo-Elements: Styling Parts of Elements
- Modern Selectors: :is(), :where(), :not(), :has()
Chapter 3: The Cascade Explained: Specificity, Inheritance, and Source Order
- How the Cascade Resolves Conflicts
- Calculating Specificity
- Inheritance: What Inherits and What Does Not
- Source Order Matters
- Importance and !important
- Initial, Inherited, Unset, Revert Values
Chapter 4: The Box Model: Everything Is a Box
- Understanding Boxes: Content, Padding, Border, Margin
- Width and Height: How They Really Work
- The box-sizing Property
- Margins: Collapse, Negative Values, and Edge Cases
- Overflow: Controlling Content That Does Not Fit
- Borders and Rounded Corners
Chapter 5: Typography: Working with Text
- Font Families and the Web Safe Font Stack
- Font Size Units and Scaling
- Font Weight, Style, and Variant
- Line Height, Letter Spacing, and Word Spacing
- Text Alignment, Decoration, and Transformation
- Web Fonts: @font-face and System Integration
Chapter 6: Colors, Backgrounds, and Visual Surfaces
- Color Formats: Named, Hex, RGB, HSL, OKLCH
- Background Colors and Images
- Multiple Backgrounds and Layering
- Gradients: Linear and Radial
- Box Shadows and Text Shadows
- Opacity vs. Transparent Colors
Chapter 7: Normal Flow, Positioning, and Stacking
- Normal Flow and Document Order
- Containing Blocks and Formatting Contexts
- The position Property: Static, Relative, Absolute, Fixed, Sticky
- Floats and Their Modern Role
- Stacking Contexts and z-index
- Multi-Column Layouts
Chapter 8: Flexbox: One-Dimensional Layout
- When to Use Flexbox
- Flex Container Properties
- Flex Item Properties
- Alignment and Distribution in Flexbox
- Wrapping and Multi-Line Flex Layouts
- Real-World Flexbox Patterns: Navbars, Cards, Centering
Chapter 9: CSS Grid: Two-Dimensional Layout
- When to Use Grid Over Flexbox
- Defining Tracks: Columns, Rows, and Gaps
- Placing Items on the Grid
- Named Grid Areas
- Auto Placement and Dense Packing
- Subgrid and Nested Layouts
- Intrinsic Sizing: min-content, max-content, fit-content
- Complete Grid Layout Example: Dashboard
Chapter 10: Responsive Layout Design
- The Philosophy of Responsive Design
- Media Queries: Syntax and Features
- Container Queries: Component-Level Responsiveness
- Fluid Typography with clamp()
- Breakpoint Strategy and Mobile-First Design
- Logical Properties for International Layouts
- Complete Responsive Layout Example
Chapter 11: Custom Properties, Calculations, and Dynamic Values
- CSS Custom Properties: Definition and Usage
- Cascading Variables: Scope and Inheritance
- Mathematical Functions: calc(), min(), max()
- Clamping Values with clamp()
- Environment Variables for Safe Areas
- Building Design Tokens with Custom Properties
Chapter 12: Transitions, Animations, and Motion
- Transitions: Smooth Property Changes
- Transform: Moving, Scaling, Rotating Elements
- 3D Transforms and Perspective
- Animations and Keyframes
- Easing Functions and Timing
- Scroll-Driven Animations and Performance Tips
Chapter 13: Advanced Visual Effects
- Filters: Blur, Contrast, Hue Rotate, and More
- Blend Modes for Colors and Images
- Backdrop Filters for Glass Effects
- Masks and Masking Images
- Clipping Paths and clip-path
- Shapes and Float Shapes
- Generated Content, Counters, and Advanced Pseudo-Elements
Chapter 14: CSS Architecture and Maintainability
- The Problem of Growing Stylesheets
- Naming Conventions: BEM and Alternatives
- Cascade Layers (@layer)
- Utility Classes and Atomic CSS
- Component Architecture and Scoping
- Design Systems and Token-Based Theming
Chapter 15: Accessibility, Compatibility, and Production Readiness
- Styling for Accessibility: Focus and Visibility
- Respecting User Preferences: Reduced Motion, High Contrast
- Dark Mode and Color Schemes
- Print Stylesheets
- Browser Compatibility and Feature Detection
- Vendor Prefixes and Autoprefixer
- Production CSS Workflows
Chapter 16: How Browsers Render CSS
- The Rendering Pipeline: Style, Layout, Paint, Composite
- Reflow and Repaint: What Triggers Them
- Compositor-Only Properties for Performance
- Diagnosing Rendering Problems
- Optimizing CSS for Speed
- Critical CSS and Loading Strategies
Chapter 17: Mastering Browser Developer Tools
- Inspecting Elements and Styles
- The Computed Tab and Cascade Panel
- Layout and Box Model Visualization
- Responsive Design Mode
- Animations and Performance Panels
- Accessibility Audits in DevTools
- Practical Debugging Scenarios