Closed kidonng closed 2 years ago
Shouldnt this rather be part of gfm?
Shouldnt this rather be part of gfm?
I think deno-gfm is general purpose and should not assume other projects are using CSS resets as well.
Take a look at GitHub's style, they don't override display
of <img>
as well:
Or look at how Tailwind deal with it: they provide a @tailwindcss/typography
plugin which you have to explicitly opt-in.
twind seems setting dispaly: block
for img by default. ref: https://github.com/tw-in-js/twind/blob/851160d9895fb2e11d6e6a9911017a5d33c8d348/src/twind/preflight.ts#L246
and we include these settings here: https://github.com/denoland/dotland/blob/a53e5cb029681cb6ae48524fda543b11313f5ff1/pages/_render.ts#L56
these styles are visible, embedded in <style id="__FRSH_STYLE">
tag in html
twind seems setting
dispaly: block
for img by default. ref: https://github.com/tw-in-js/twind/blob/851160d9895fb2e11d6e6a9911017a5d33c8d348/src/twind/preflight.ts#L246
Right, that's what I mean by "CSS reset".
Ah, ok.
BTW I did some research about reseting <img>
in this way.
normalize.css
and modern-normalize
don't do this reset, but tailwind (and therefore twind) does this https://github.com/tailwindlabs/tailwindcss/blob/f980ca4ca4a74eb39dc1f17f67373f117e2b1052/src/css/preflight.css#L339-L347
This practice seems to have started in the discussion in CSS remedy https://github.com/jensimmons/cssremedy/issues/14
Thanks for the info, that's something new to me.
Block images by default are fine, but this is user content we can't control (hence the .markdown-body
prerequisite), they should behave normally and just like e.g. GitHub's rendering.
Fix #2038 Test: https://dotland-fresh-ggcxpmcsd6tg.deno.dev/x/cronnor@v1.3.0/README.md
I'm not sure but probably there are more issues caused by CSS reset 🤷