Skip to content

Commit

Permalink
New tets for use of currentColor in @font-palette-values
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike authored and svgeesus committed Nov 18, 2021
1 parent d3cd862 commit e14ed86
Show file tree
Hide file tree
Showing 3 changed files with 91 additions and 0 deletions.
28 changes: 28 additions & 0 deletions css/css-fonts/font-palette-35-ref.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Tests use of currentColor in @font-palette-values</title>
<link rel="help" href="https://drafts.csswg.org/css-fonts/#font-palette-prop">
<link rel="help" href="https://drafts.csswg.org/css-fonts-4/#font-palette-values">
<link rel="author" title="Mike Bremford" href="https://bfo.com">
<style>
@font-face {
font-family: "COLR-test-font";
src: url("resources/COLR-palettes-test-font.ttf") format("truetype");
}
@font-palette-values --MyPalette {
font-family: "COLR-test-font";
override-colors: 7 #00FF00;
}

div {
font: 48px 'COLR-test-font';
font-palette: --MyPalette;
}
</style>
</head>
<body>
<div>A</div>
</body>
</html>
30 changes: 30 additions & 0 deletions css/css-fonts/font-palette-35.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Tests use of currentColor in @font-palette-values</title>
<link rel="help" href="https://drafts.csswg.org/css-fonts/#font-palette-prop">
<link rel="help" href="https://drafts.csswg.org/css-fonts-4/#font-palette-values">
<link rel="author" title="Mike Bremford" href="https://bfo.com">
<link rel="match" href="font-palette-35-ref.html">
<style>
@font-face {
font-family: "COLR-test-font";
src: url("resources/COLR-palettes-test-font.ttf") format("truetype");
}
@font-palette-values --MyPalette {
font-family: "COLR-test-font";
override-colors: 7 currentColor;
}

div {
color: #00FF00;
font: 48px 'COLR-test-font';
font-palette: --MyPalette;
}
</style>
</head>
<body>
<div>A</div>
</body>
</html>
33 changes: 33 additions & 0 deletions css/css-fonts/font-palette-36.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Tests currentColor in @font-palette-values is inherited as currentColor</title>
<link rel="help" href="https://drafts.csswg.org/css-fonts/#font-palette-prop">
<link rel="help" href="https://drafts.csswg.org/css-fonts-4/#font-palette-values">
<link rel="author" title="Mike Bremford" href="mailto:mike@bfo.com">
<link rel="match" href="font-palette-35-ref.html">
<style>
@font-face {
font-family: "COLR-test-font";
src: url("resources/COLR-palettes-test-font.ttf") format("truetype");
}
@font-palette-values --MyPalette {
font-family: "COLR-test-font";
override-colors: 7 currentColor;
}
div {
color: red;
font: 48px 'COLR-test-font';
font-palette: --MyPalette;
}
span {
color: #00FF00;
}

</style>
</head>
<body>
<div><span>A</span></div>
</body>
</html>

0 comments on commit e14ed86

Please sign in to comment.