fix: markdown rendering for custom types#483
Conversation
| position: absolute; | ||
| inset: 0; | ||
| background-color: var(--s2-gray-25); | ||
| mask-image: url("/nx2/img/icons/S2_Icon_Checkmark_20_N.svg"); |
There was a problem hiding this comment.
mask-image: url("/nx2/img/icons/S2_Icon_Checkmark_20_N.svg") is a hardcoded absolute asset path. breaks if the asset structure ever moves. we have flagged this before (see other icon usage with loadHrefSvg). @hannessolo what was the decision here?
There was a problem hiding this comment.
Yes, we should use <svg><use> wherever possible. The icons shouldn't be added to the code, but referenced directly from da.live, eg. https://da.live/img/icons/s2-icon-checkmark-20-n.svg
There was a problem hiding this comment.
This is pure styling, so didnt want to add an svg. I'll update to have the live url then - I saw a couple other similar usages, will adapt those in parallel as well.
There was a problem hiding this comment.
Yes, that's why "wherever possible" - I think here your approach might make more sense. But I'm not sure, will dark mode work with mask-image?
In either case we should use the URL from da.live instead of adding the svg to the code.
There was a problem hiding this comment.
Yes, currentcolor on the background will inherit the parent color. I'll adapt to use the url -> for the others I think we might need to first add the icons to da live
| width: 14px; | ||
| height: 14px; | ||
| flex-shrink: 0; | ||
| margin-top: 4px; |
There was a problem hiding this comment.
we're using var(--s2-spacing-75) right next to these. do spacing tokens cover 4px and 6px? if so, let's use them too.
|
Nice, looks much better! I'm fine with the current implementation for now, but as an improvement we should find a way to already render the correct style before the closing tag appears. |
Preview at https://da.live/canvas?nx=ew-md&nxver=2#/exp-workspace/frescopa/index