Skip to content

Conversation

Shrinivassab
Copy link
Contributor

Add reference for CSS value serialization, especially colors

Fixes #32734

Description

Adds a new guide explaining CSS value serialization through JavaScript APIs, with a focus on how color values (hsl(), hwb(), etc.) are serialized to rgb()/rgba() format when accessed via getComputedStyle() or getPropertyValue().

Motivation

This documentation helps developers understand why and how CSS values, especially colors, might return in different formats than they were written. This addresses a common source of confusion when working with CSS values through JavaScript APIs.

Additional details

References:

Related issues and pull requests

Fixes #32734 - Creates documentation for CSS value serialization, especially for colors

Fixes mdn#32734

Adds a new guide explaining how CSS values especially colors are serialized when accessed via JavaScript APIs like getComputedStyle() and getPropertyValue().
@Shrinivassab Shrinivassab requested a review from a team as a code owner September 28, 2025 23:03
@Shrinivassab Shrinivassab requested review from sideshowbarker and removed request for a team September 28, 2025 23:03
@github-actions github-actions bot added the Content:WebAPI Web API docs label Sep 28, 2025
@github-actions github-actions bot added the size/m [PR only] 51-500 LoC changed label Sep 28, 2025
Copy link
Contributor

github-actions bot commented Sep 28, 2025

Preview URLs

Flaws (3)

URL: /en-US/docs/Web/API/CSS_Object_Model/Serializing_CSS_values
Title: Serializing CSS values
Flaw count: 3

  • broken_links:
    • /en-US/docs/Web/CSS/Using_CSS_custom_properties is a redirect
  • unknown:
    • Error serializing baseline for numeric-seperators: missing field description``
    • Error serializing baseline for single-color-gradients: missing field description``
External URLs (2)

URL: /en-US/docs/Web/API/CSS_Object_Model/Serializing_CSS_values
Title: Serializing CSS values

(comment last updated: 2025-09-29 04:05:11)

@Josh-Cena Josh-Cena requested review from estelle and removed request for sideshowbarker September 28, 2025 23:28
Copy link
Member

@Josh-Cena Josh-Cena left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A lot of content is incomplete or duplicative. I suspect you are using AI to write this, which is fine in principle, but next time please disclose this because it's not the quality we are expecting for a ready-for-review PR. Also, you should document length serialization as well at least, since that's the other common use case.

@Shrinivassab
Copy link
Contributor Author

Hi @Josh-Cena , Yes, I tried the Co-pilot version of Sonnet 3.5. I will keep it in mind to mentioned that in the PR, I was not sure, if we used Copilot need to raise as Draft PR or Ready to reviewPR.

@Shrinivassab
Copy link
Contributor Author

Let me know if any changes need to be updated or any grammatical error . Happy to update it. Thanks for the review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:WebAPI Web API docs size/m [PR only] 51-500 LoC changed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reference for CSS value serialization, especially as it relates to colors
2 participants