Skip to main content

Module ua_css

Module ua_css 

Source
Expand description

Built-in user-agent default stylesheet. User-Agent Default Stylesheet for Azul

This module provides the default CSS styling that browsers apply to HTML elements before any author stylesheets are processed. It ensures consistent baseline behavior across all applications.

The user-agent stylesheet serves several critical functions:

  1. Prevents Layout Collapse: Ensures root elements (<html>, <body>) have default dimensions so that percentage-based child sizing can work correctly.

  2. Establishes Display Types: Defines the default display property for all HTML elements (e.g., <div> is block, <span> is inline).

  3. Provides Baseline Typography: Sets reasonable defaults for font sizes, margins, and text styling for headings, paragraphs, and other text elements.

  4. Normalizes Browser Behavior: Incorporates principles from normalize.css to provide consistent rendering across different platforms.

§Licensing

Based on principles from normalize.css (MIT License, Copyright Nicolas Gallagher and Jonathan Neal). This is NOT a direct copy but incorporates its principles and approach.

§References

  • CSS 2.1 Specification: https://www.w3.org/TR/CSS21/
  • HTML Living Standard: https://html.spec.whatwg.org/
  • normalize.css: https://necolas.github.io/normalize.css/

Structs§

ResolvedUaScrollbar
Resolved UA scrollbar defaults after evaluating conditions.

Functions§

evaluate_ua_scrollbar_css
Evaluate UA scrollbar CSS rules against a DynamicSelectorContext.
get_ua_property
Returns the default user-agent CSS property value for a given node type and property.