vuepress-theme-hope / vuepress-theme-hope

A vuepress theme with tons of features✨
https://theme-hope.vuejs.press
MIT License
2.13k stars 746 forks source link

[Bug] #3604

Closed HuberTRoy closed 1 year ago

HuberTRoy commented 1 year ago

Checklist

Package name

vuepress-theme-hope

Which operating system are you using?

Describe the bug

https://github.com/vuepress-theme-hope/vuepress-theme-hope/blob/4df6e344f7c3651f46b9097e47fbc096a53244dd/packages/theme/templates/index.build.html#L15

The template on prod hardcode the background.

The configuration background on palette.scss not working fully.

Additional context

No response

Mister-Hope commented 1 year ago

Have you ever test that? Normally, body is on html and sharing the same size, so the bgcolor will be applied correctly.

github-actions[bot] commented 1 year ago

Hello @HuberTRoy. Please provide a minimal reproduction using a GitHub repository or vuepress-theme-hope.github.io/v2-new. Issues marked with needs reproduction will be closed if they have no activity within 3 days.

Mister-Hope commented 1 year ago

image Try not waste others time image

github-actions[bot] commented 1 year ago

Hello @HuberTRoy. This issue is marked as invalid and closed. Please make sure you are reporting an issue and following the issue template.

HuberTRoy commented 1 year ago

@Mister-Hope Sorry for waste your time.

Please see https://github.com/subquery/documentation, check out on 0f9042f4f5a1941df508814a09281e0aa2cd90bc.

Build and serve it.

The config is darkmode only and have configaration with

$bg-color: (
  light: #060f32,
  dark: #060f32,
);

微信截图_20231107200101

微信截图_20231107200110

I don't find relative changes on the new version change log. If it has been change.

HuberTRoy commented 1 year ago

The key I think is only compile palette.scss as :root and the hardcode is

      html[data-theme="dark"] {
        --bg-color: #1d1e1f;
      }

      html,
      body {
        background: var(--bg-color);
      }

The priority of html[data-theme="dark"] greater than :root, so var(--bg-color) is hardcode not custom.

Mister-Hope commented 1 year ago

Hi like I said above, the final color displayed should be body’s bgcolor

Mister-Hope commented 1 year ago

I am not sure, as you are already applying a patch.

Just take our theme docs as an example:

image

The body background color comes from css file:

image

While the color defined in template is already overrided:

image

Create a new template and try modifying $bg-color, everthing should work as expected.

I am curious why you need an !important