marp-team / marp-core

The core of Marp converter
MIT License
750 stars 127 forks source link

Overriding hljs-attr color does not work #352

Closed weshouman closed 11 months ago

weshouman commented 11 months ago

Version of Marp Tool

marp-vscode

Operating System

Linux

Environment

How to reproduce

Using gaia theme (did not test on other themes) the setting of the hljs-attr's color does not work.

The following example shall illustrate how to reproduce the issue

<style>
code .hljs-attr { color: red; } /* expected to be correct */
code .hljs-attribute { color: orange;  } /* not expected to be correct */
</style>
---
This is a code sample `should_not_change`
  ```yaml
  attr_should_be_in_red: "string"

### Expected behavior

hljs-attr selector shall set the color of the hljs-attr section

### Actual behavior

hljs-attr selector does not set the color of the hljs-attr section

### Additional information

### Workaround

We could update the root to change the hljs-attr and the oneliner text color.
````css
<style>
:root { --color-background: red } /* unexpectedly sets the hljs-attr */
</style>
---
This is a code sample `printf()`
  ```yaml
  attr: "string"
yhatt commented 11 months ago

Could not reproduce. The style that you presented will change the attribute color to red correctly.

---
marp: true
theme: gaia
---

<style>
code .hljs-attr { color: red; }
</style>

```yaml
attr: "string"


![untitled](https://github.com/marp-team/marp-core/assets/3993388/afbb3fc3-7a9e-4528-91e0-ab013d5d1d1b)
weshouman commented 11 months ago

I'll close it as I'm also not able to reproduce it again.