Skip to content

Commit

Permalink
data: add light-dark function
Browse files Browse the repository at this point in the history
  • Loading branch information
hteumeuleu committed Aug 14, 2024
1 parent 6f0f8ca commit 52747d2
Show file tree
Hide file tree
Showing 2 changed files with 228 additions and 0 deletions.
167 changes: 167 additions & 0 deletions _features/css-function-light-dark.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
---
title: "light-dark()"
description: "Enables setting two colors (one for light and the other for dark mode) for a property."
category: css
keywords: dark, light
last_test_date: "2024-08-14"
test_url: "/tests/css-function-light-dark.html"
test_results_url: "https://app.emailonacid.com/app/acidtest/Lai13xyIE95H6jo1BBs6ay0f3RvJdPL344S3j3M7FbeU4/list"
stats: {
apple-mail: {
macos: {
"16.0":"y #1"
},
ios: {
"17.5.1":"y"
}
},
gmail: {
desktop-webmail: {
"2024-08":"n"
},
ios: {
"2024-08":"n"
},
android: {
"2024-08":"n"
},
mobile-webmail: {
"2024-08":"n"
}
},
orange: {
desktop-webmail: {
"2024-08":"n"
},
ios: {
"2024-08":"n"
},
android: {
"2024-08":"u"
}
},
outlook: {
windows: {
"2007":"n",
"2010":"n",
"2013":"n",
"2016":"n",
"2019":"n"
},
windows-mail: {
"2024-08":"n"
},
macos: {
"16.88":"n"
},
outlook-com: {
"2024-08":"n"
},
ios: {
"2024-08":"n"
},
android: {
"2024-08":"u"
}
},
samsung-email: {
android: {
"6.0":"u"
}
},
sfr: {
desktop-webmail: {
"2024-08":"a #2"
},
ios: {
"2024-08":"a #1 #2"
},
android: {
"2024-08":"u"
}
},
thunderbird: {
macos: {
"115.10.1":"n",
"128.1.0":"y",
}
},
aol: {
desktop-webmail: {
"2024-08":"n"
},
ios: {
"2024-08":"n"
},
android: {
"2024-08":"u"
}
},
yahoo: {
desktop-webmail: {
"2024-08":"n"
},
ios: {
"2024-08":"n"
},
android: {
"2024-08":"u"
}
},
protonmail: {
desktop-webmail: {
"2024-08":"a #2"
},
ios: {
"2024-08":"y #1"
},
android: {
"2024-08":"u"
}
},
hey: {
desktop-webmail: {
"2024-08":"a #2"
}
},
mail-ru: {
desktop-webmail: {
"2024-08":"a #2"
}
},
fastmail: {
desktop-webmail: {
"2024-08": "u"
}
},
laposte: {
desktop-webmail: {
"2024-08": "a #2"
}
},
free-fr: {
desktop-webmail: {
"2024-08": "n"
}
},
t-online-de: {
desktop-webmail: {
"2024-08": "a #2"
}
},
gmx: {
desktop-webmail: {
"2024-08": "n"
},
},
}
notes_by_num: {
"1": "Only supported if you’ve updated your OS with Safari 17.5 or later.",
"2": "Buggy. The function is supported but the color stays light even in dark mode.",
}
links: {
"Can I use: light-dark()":"https://caniuse.com/mdn-css_types_color_light-dark",
"MDN: light-dark()":"https://developer.mozilla.org/en-US/docs/Web/CSS/color_value/light-dark",
"WebKit Features in Safari 17.5":"https://webkit.org/blog/15383/webkit-features-in-safari-17-5/",
}
---
61 changes: 61 additions & 0 deletions tests/css-function-light-dark.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<!DOCTYPE html>
<html lang="en" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office">
<head></head>
<head>
<meta charset="UTF-8" />
<title>Can I email</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="x-apple-disable-message-reformatting" />
<meta name="color-scheme" value="light dark" />
<meta name="supported-color-schemes" content="light dark" />
<!--[if mso]>
<xml>
<o:OfficeDocumentSettings>
<o:PixelsPerInch>96</o:PixelsPerInch>
</o:OfficeDocumentSettings>
</xml>
<![endif]-->
<style>
:root {
color-scheme: light dark;
}
</style>
</head>
<body>
<div style="max-width:600px; margin:0 auto;">
<h1 style="margin:0 0 1em; font:38px Palatino, serif; color:#000; background:none; border:none;">
CSS light-dark() function
</h1>
<h2 style="margin:0 0 1em; font:bold 16px monospace;">
color: light-dark(blue, green);
</h2>
<div style="font:20px serif; color:red;">
<p style="color:light-dark(blue, green);">
Named values. Lorem ipsum dolor sit amet consectetur adipisicing elit. Necessitatibus, adipisci! Cum harum quaerat maxime obcaecati ullam est necessitatibus, accusamus vero aperiam eius iusto quas inventore error facere rerum, suscipit earum!
</p>
<p style="color:light-dark(#00f, #0f0);">
Hex values. Lorem ipsum dolor sit amet consectetur adipisicing elit. Necessitatibus, adipisci! Cum harum quaerat maxime obcaecati ullam est necessitatibus, accusamus vero aperiam eius iusto quas inventore error facere rerum, suscipit earum!
</p>
</div>
<h2 style="margin:0 0 1em; font:bold 16px monospace;">
background-color: light-dark(blue, green);
</h2>
<div style="font:20px serif; background-color:red;">
<p style="margin:0; background-color:light-dark(blue, green);">
Named values. Lorem ipsum dolor sit amet consectetur adipisicing elit. Necessitatibus, adipisci! Cum harum quaerat maxime obcaecati ullam est necessitatibus, accusamus vero aperiam eius iusto quas inventore error facere rerum, suscipit earum!
</p>
<p style="margin:0; background-color:light-dark(#00f, #0f0);">
Hex values. Lorem ipsum dolor sit amet consectetur adipisicing elit. Necessitatibus, adipisci! Cum harum quaerat maxime obcaecati ullam est necessitatibus, accusamus vero aperiam eius iusto quas inventore error facere rerum, suscipit earum!
</p>
</div>
<p style="margin-top:1.6em; font:20px serif;">
https://developer.mozilla.org/en-US/docs/Web/CSS/color_value/light-dark<br />

</p>
<p style="margin-top:1.6em; font:20px serif;">
<a href="https://www.caniemail.com" style="color:#000; text-decoration:none;">caniemail.com</a>, 2024.
</p>
</div>
</body>
</html>

0 comments on commit 52747d2

Please sign in to comment.