Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explicit CSS selectors with more specificity override code block color in light mode #1806

Open
xypnox opened this issue Mar 12, 2024 · 2 comments

Comments

@xypnox
Copy link
Contributor

xypnox commented Mar 12, 2024

What Are You Doing?

Apply a custom color scheme and use a code-block element in light mode.

Eg: https://www.xypnox.com/spellcraft/docs/components/code/

Expected Behaviour:

The color should be set as defined in the colors.

Screenshot 2024-03-12 at 22-09-19 Code

Current Behavior

The background is overridden and the light theme colors are being applied:

Screenshot 2024-03-12 at 22-10-16 Code

Possible Solution

Perhaps these lines may be the culprit:

:not(pre)>code[class*=language-].fastn-theme-light,
pre[class*=language-].fastn-theme-light {
background: #f5f2f0
}

Your Environment

  • fastn Version (I.e, output of fastn -v): 0.4.57
  • Operating System: Linux
  • Web Browser: Firefox
@amitu
Copy link
Contributor

amitu commented Mar 13, 2024

@xypnox can you propose some change that will fix it? A PR would be good.

@xypnox
Copy link
Contributor Author

xypnox commented Mar 13, 2024

@amitu

I can understand how the css has more specificity but I am unsure about how this theme css file is used within fastn. The search gave me commented lines which probably won't be the issue:

let mut light_theme = include_str!("../../theme/fastn-theme.light.tmTheme").as_bytes();
theme_set.themes.insert(
"fastn-theme.light".to_owned(),
syntect::highlighting::ThemeSet::load_from_reader(&mut light_theme).unwrap(),
);

Moreover I don't understand why fastn-theme is being used in the build when I have not specified any dependency on it. Has it been misnamed? (eg: fastn-reset / fastn-default-styles)

Also why are there so many css files in the same directory.

cc. @Heulitig @Arpita-Jaiswal

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants