sanity-io / sanity-plugin-markdown

Markdown support in the Sanity Studio
MIT License
51 stars 8 forks source link

fix: selected text color #92

Closed manaskhandelwal closed 10 months ago

manaskhandelwal commented 10 months ago

The selected text color (theme.sanity.color.selectable.primary.hovered.bg) was causing the editor to completely crash.

I assume its because of the transition to the new UI, but this fix should be enough for now.

robinpyon commented 10 months ago

Thanks so much for your PR @manaskhandelwal, and apologies for the latency here.

The reason for the linked issue is two-fold:

  1. The latest version of the Studio (which supplies the theme object) wasn't supplying the correct value, returning an empty value for theme.sanity.color.selectable
  2. the theme.sanity.color.selectable object is marked as optional in its type definition, and the plugin wasn't correctly checking for its existence before accessing nested values.

A recent release (4.1.1) addresses point 2 above, and the next studio release will address point 1 – ensuring that these colours remain consistent.