Skip to content

F24: personal stylesheets may change the color at any level #4450

@innoticFR

Description

@innoticFR

In technique F24, it's written some contradictory info :

In the About part:

This failure applies to all technologies that allow user agents to control foreground and background colors through personal stylesheets

In the Description

Since CSS color properties inherit from ancestor elements, it is sufficient if both foreground and background colors are defined either directly or through inheritance by the time that color is applied to a given element.

Let's say the website has defined both the body and color:

body {
  color: #1d1d1d;
  background-color: #fafafc;
}

main {
   color: navy;
}

Here we have no problem of contrast.

According to F24, the fact that main inherits from the body background-color makes the test successful.

Now, if I want to use a personal stylesheet with my own CSS rule for the body I can override the default style with the following rule :

body {
  color: yellow;
  background: navy;
}

I can no longer have a correct contrast between <main> color, and <body> background color, although this was the intent of F24.

I use to test this using the :root selector instead of body but that's quite cheating because users may use the body selector. What's your opinion about that?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions