Skip to main content

Module ua_css

Module ua_css 

Source
Expand description

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

This user-agent stylesheet integrates principles from normalize.css v8.0.1:

  • normalize.css License: MIT License Copyright (c) Nicolas Gallagher and

The normalize.css project is licensed under the MIT License, which permits commercial use, modification, distribution, and private use. The full license text is as follows:

MIT License

Copyright (c) Nicolas Gallagher and Jonathan Neal

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

This implementation is NOT a direct copy of normalize.css but incorporates its principles and approach. The Azul project’s overall license applies to this implementation.

§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/

Functions§

get_ua_property
Returns the default user-agent CSS property value for a given node type and property.