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

Make primary color (navigation hightlight, section titles) configurable #138

Closed
jorisvandenbossche opened this issue Mar 28, 2020 · 6 comments

Comments

@jorisvandenbossche
Copy link
Member

Currently we are using a "dark shade of blue-magenta" (according to google :)) for certain elements in the theme:

  • For h1 and h2 in the main content
  • For active links in the navigation (navbar, left sidebar, toc sidebar)

I think historically we started using it for the active navigation links for the pandas docs because this is the "dark purple" of the pandas logo, to have it match with the logo / general pandas style.
(although it seems now it is actually a slight variant, it's not the exact same color (#150458 vs #130654), although not really a visible difference)

I think it might make sense to:

  • Use some kind of variable for those colors, so it is easy for users to override this color in a single place
  • Possibly use a different default color, so pandas can use the "pandas purple" to customize their docs (but if people like the purple, also no problem with keeping it)

cc @hoetmaaiers @choldgraf

@choldgraf
Copy link
Collaborator

I'm a fan of both ideas. I do think the purple is a bit opinionated for a default color (I'd go with something like a nice blue myself)

@hoetmaaiers
Copy link
Collaborator

Been thinking about this, I think we have these options:

  1. Define the configuration in a separate css file which is not processed by Webpack and thus is regular css ready for most browsers. In here we can define css variables. The browser support is good, with the exception of IE11.
  2. Use the same configuration file as in solution 1, but define as scss and pass it through Webpack. Support by all browsers, even IE11, but a theme build should happen for every custom themed installation.
  3. Define variables in Python is possible to, but it should always result in a stylesheet of type 1 or 2 I think.

My gut preference goes to solution 1. We can provide fallback styling (probably the default themed style?) which is what IE11 browsers will display. All other modern browsers see the beautiful themed documentation website.
IE11 usage is still present in large corporations which have stubborn IT departments, but the software itself isn't supported by Microsoft itself.

Any thoughts to add these options?

@jorisvandenbossche
Copy link
Member Author

Yes, if the "no IE11 support" means that in IE11 the customized colors are not shown but for the rest it still displays correctly with some default colors, I am totally fine with not supporting IE11 on this aspect.

@choldgraf
Copy link
Collaborator

I'm also fine not supporting IE11 - this may be an assumption, but my guess is that the kind of user that is programming in python is not the kind of user that generally uses IE11...

@12rambau
Copy link
Collaborator

12rambau commented Jun 4, 2022

We are about to release v0.9 and I think the current implementation of color variables covers this issue (https://github.com/pydata/pydata-sphinx-theme/blob/main/src/pydata_sphinx_theme/assets/styles/variables/_color.scss) Can we consider this one solved ?

@choldgraf
Copy link
Collaborator

Yep, I think this is now resolved!

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

No branches or pull requests

4 participants