diff options
author | Bradley Taunt <bt@btxx.org> | 2024-07-05 16:39:27 -0400 |
---|---|---|
committer | Bradley Taunt <bt@btxx.org> | 2024-07-05 16:39:27 -0400 |
commit | b3bf04932880e9f984675cff5d70da58167316cc (patch) | |
tree | db30313e5cd51988af36e480077e6456b8590b62 /posts/current-color.md | |
parent | cc72ef25c6de2b0004c163d06486d949acf3c78c (diff) |
Start converting code samples into cleaner markdown chunks
Diffstat (limited to 'posts/current-color.md')
-rw-r--r-- | posts/current-color.md | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/posts/current-color.md b/posts/current-color.md index bb9fe99..1e82067 100644 --- a/posts/current-color.md +++ b/posts/current-color.md @@ -10,27 +10,27 @@ Let's assume with have a single div with the following properties: - - div { - color: dodgerblue; - } - +~~~css +div { + color: dodgerblue; +} +~~~ If we wanted to use that same color for other properties on elements inside that initial `div`, it's simple - we just need to call `currentColor` like so: +~~~css +div { + color: dodgerblue; +} - div { - color: dodgerblue; - } - - div header { - background-color: currentColor; - } - - div a { - border-bottom: 1px solid currentColor; - } +div header { + background-color: currentColor; +} +div a { + border-bottom: 1px solid currentColor; +} +~~~ **Sidenote**: If you re-declare the default `color` property further along in your CSS, the `currentColor` value will update according to the last color set. |