8000 [Cascade / Pseudo-elements / Values / Fragmentation] currentColor when fragments have differents colors · Issue #1510 · w3c/csswg-drafts · GitHub
[go: up one dir, main page]

Skip to content

[Cascade / Pseudo-elements / Values / Fragmentation] currentColor when fragments have differents colors #1510

@Loirooriol

Description

@Loirooriol

CSS Color says

The keyword currentcolor represents value of the color property on the same element.

But what if different fragments of that element have different colors? This is possible with ::first-line.

Example: https://jsfiddle.net/ehzknab5/2/
<div><span>Lorem ipsum<br />dolor amet.</span></div>
<div><span>Lorem ipsum.</span></div>
div {
  color: red;
}
div::first-line {
  color: green;
}
br {
  line-height: 0;
}
span {
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  line-height: 50px;
  background-image: linear-gradient(currentcolor, currentcolor);
  background-color: currentColor;
  background-size: 100% 75%;
  background-repeat: no-repeat;
  border: 5px solid currentColor;
  outline: 5px solid currentColor;
  box-shadow: 111px 0 5px currentColor;
  text-shadow: 222px 0 2px currentColor;
  filter: drop-shadow(333px 0 0 currentColor);
}

Firefox:

firefox

Chrome:

chrome

Edge:

edge

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0