Skip to content

Commit

Permalink
Update lch til
Browse files Browse the repository at this point in the history
  • Loading branch information
jakelazaroff committed Dec 3, 2024
1 parent 6acf412 commit f9d4851
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ Devon's example makes two big changes:
1. It discards the chroma and hue values, replacing them with `0`.
2. It inverts the color's lightness and multiplies it by `infinity` to obtain white or black.

#2 might be confusing, so let's dig into some examples. Remember, the calculation is `(49.44 - l) * infinity`, clamped within the range `[0, 100]`:
#2 might be confusing, so let's dig into some examples. The basic idea is that if a color's lightness is _above_ some threshold value, we want the text to be black; if it's _below_ that value, we want the text to be white.

Remember, the calculation is `(49.44 - l) * infinity`, clamped within the range `[0, 100]`:

- CSS `red` has an LCH lightness of `54.29`.
1. `49.44` - `54.29` = `-4.85`
Expand Down
2 changes: 1 addition & 1 deletion prosemirror/prevent-extra-whitespace-in-nodeviews.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
While trying to build a [ProseMirror `NodeView`](https://prosemirror.net/docs/ref/#view.NodeView) using a [Shoelace dropdown](https://shoelace.style/components/dropdown), I kept getting a ton of extra vertical space around the dropdown trigger.

The fix turned out to be really simple. ProseMirror sets some styles on its root element. The culprit turned out to be [`white-space: break-spaces`](https://developer.mozilla.org/en-US/docs/Web/CSS/white-space#break-spaces) — an inherited style which preserves newline characters.
gi

I didn't want to override that style for the whole ProseMirror element, but setting `white-space: normal` on the `NodeView` element fixed it easily.

0 comments on commit f9d4851

Please sign in to comment.