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

Inline code style for admonition seems odd due to override #2492

Closed
5 tasks done
polarathene opened this issue Mar 26, 2021 · 4 comments
Closed
5 tasks done

Inline code style for admonition seems odd due to override #2492

polarathene opened this issue Mar 26, 2021 · 4 comments
Labels
change request Issue requests a new feature or improvement resolved Issue is resolved, yet unreleased if open

Comments

@polarathene
Copy link
Contributor

polarathene commented Mar 26, 2021

  • I've read the [contribution guidelines][1] and agree with them

I've found a bug and checked that ...

  • ... the problem doesn't occur with the default MkDocs template
  • ... the problem is not in any of my customizations (CSS, JS, template)
  • ... the documentation does not mention anything about my problem
  • ... there are no open or closed issues that are related to my problem

Description

I don't quite get the reasoning for this override?:

// Omit background on inline code blocks, as they don't go well with the
// pastelly tones applied to admonition titles
code {
margin: initial;
padding: initial;
color: currentColor;
background-color: transparent;
border-radius: initial;
box-shadow: none;
}

How is the override visually better? If it was a concern for the user they might as well at that point just not use the inline code syntax?

If the concern is with contrast, wouldn't it be better to instead use alpha?

Expected behavior

EDIT: See the comparison images below in the 2nd message.

original examples

Any of the following:

  1. Restore bg-color:
    Screenshot_20210326_191218

  2. Full restore:
    Screenshot_20210326_191806

  3. Change bg-color to brighter shade with opacity (#ffffffbf):
    Screenshot_20210326_192119

  4. Change bg-color to darker shade with opacity (#3a3a3a30):
    Screenshot_20210326_193014

  5. Change bg-color to better match admonition colour (#d7d7d7ad with CSS mix-blend-mode: multiply):
    Screenshot_20210326_193301

  6. or with mix-blend-mode: luminosity:
    Screenshot_20210326_193734

Personally 3 or 6 look quite nice.

Actual behavior

Screenshot_20210326_191133

Package versions / Project configuration / System information

Active release used for project demo site (if modified to use an inline code block in admonition title): https://squidfunk.github.io/mkdocs-material/reference/admonitions

@polarathene
Copy link
Contributor Author

Replacing the referenced CSS rules to be only the 3 changes below with different blend modes looks much better personally. I've also included at the end how these look with current override, and override removed for comparison.


Difference

color: currentColor;
background-color: #bbbbbba3;
mix-blend-mode: difference;

Screenshot_20210326_195545


Color-Burn

color: currentColor;
background-color: #444;
mix-blend-mode: color-burn;

Screenshot_20210326_200928


Luminosity

color: currentColor;
background-color: #ccc;
mix-blend-mode: luminosity;

Screenshot_20210326_201339


Multiply

color: currentColor;
background-color: #e8e8e8;
mix-blend-mode: multiply;

Screenshot_20210326_201804


Just light bg with opacity:

background-color: #ffffffb7

Screenshot_20210326_202427


All overrides removed:

Screenshot_20210326_202527


All overrides applied (current upstream style)

Screenshot_20210326_202619

@squidfunk
Copy link
Owner

Thanks for your suggestions.

If the concern is with contrast, wouldn't it be better to instead use alpha?

We've used alpha values for code block colors in the past, and it came with other problems, for example when using line numbers with the pymdownx-inline method, which some users prefer to the table-based solution. The code was shining through the line numbers when scrolling, so we had to switch to opaque colors.

IIRC (it's a long time ago), we removed the background because we've used alpha values, so since that's no longer true, we might add it back. After all, it's more consistent, and I'm fine with the look. With the alpha approach, it looked really bad.

@squidfunk
Copy link
Owner

Removed override in cb8d3f4.

@squidfunk squidfunk added change request Issue requests a new feature or improvement resolved Issue is resolved, yet unreleased if open labels Mar 28, 2021
@squidfunk
Copy link
Owner

Released as part of 7.0.7.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
change request Issue requests a new feature or improvement resolved Issue is resolved, yet unreleased if open
Projects
None yet
Development

No branches or pull requests

3 participants
@squidfunk @polarathene and others