marp-team / marp-vscode

Marp for VS Code: Create slide deck written in Marp Markdown on VS Code
https://marketplace.visualstudio.com/items?itemName=marp-team.marp-vscode
MIT License
1.55k stars 72 forks source link

Use `all: revert` to reset injected CSS into the slide preview by other extensions #443

Closed yhatt closed 10 months ago

yhatt commented 10 months ago

Replaced to use all: revert instead of all: initial to reset injected styles into the slide preview by other extensions.

On inherited properties, the initial value may be unexpected. You should consider using the inherit, unset, revert, or revert-layer keywords instead.

https://developer.mozilla.org/en-US/docs/Web/CSS/initial

all: initial has been tainted many children CSS properties that allowed an inherited value. In fact, using some styles displays the unexpected result.

---
marp: true
---

# Hello, <span style="position: relative;">world</span>!

https://github.com/marp-team/marp-vscode/issues/442#issuecomment-1783744775

CSS Cascading and Inheritance Level 4 allows revert keyword, to reset them into UA default correctly.

Fix #442.