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
Add panels support #641
Add panels support #641
Conversation
I'd use Sphinx Design, not Sphinx Panels (https://sphinx-design.readthedocs.io/en/latest/). The syntax is very similar though. |
Yep I saw your comment in the issue, as it's the same class I'll work with that for now and I'll update the lib name once everything works |
I think I now have something. I respected the structure initiated by @choldgraf and added 2 files in the In short you'll find in this PR:
several notes:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this improvement! I added a few suggestions.
src/pydata_sphinx_theme/assets/styles/extensions/_sphinx_design.scss
Outdated
Show resolved
Hide resolved
* cards | ||
*/ | ||
|
||
.sd-card { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know that sphinx-design uses many of its own CSS variables:
https://sphinx-design.readthedocs.io/en/latest/css_variables.html
If possible, I think it would be better to control the behavior here by using --pst
variables to set --sd
variables, rather than coding new CSS rules. Does that make sense?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
design-style .css
is loaded after pydata-sphinx-theme one so I won't be able to overwrite anything (that's also why I need to use !important
rules in lots of places). I think I can't.
<!-- Loaded before other Sphinx assets -->
<link href="_static/styles/theme.css?digest=fb52004a9691e5b75515" rel="stylesheet">
<link href="_static/styles/pydata-sphinx-theme.css?digest=fb52004a9691e5b75515" rel="stylesheet">
<link rel="stylesheet"
href="_static/vendor/fontawesome/5.13.0/css/all.min.css">
<link rel="preload" as="font" type="font/woff2" crossorigin
href="_static/vendor/fontawesome/5.13.0/webfonts/fa-solid-900.woff2">
<link rel="preload" as="font" type="font/woff2" crossorigin
href="_static/vendor/fontawesome/5.13.0/webfonts/fa-brands-400.woff2">
<link rel="stylesheet" type="text/css" href="_static/pygments.css" />
<link rel="stylesheet" type="text/css" href="_static/graphviz.css" />
<link rel="stylesheet" type="text/css" href="_static/../_font/fontawesome/css/all.min.css" />
<link rel="stylesheet" type="text/css" href="_static/../_font/fontawesome/css/all.min.css" />
<link rel="stylesheet" type="text/css" href="_static/design-style.b7bb847fb20b106c3d81b95245e65545.min.css" />
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmmm yeah this feels related to @pradyunsg's concerns about !important
in that library. @pradyunsg was there any way you got around this other than just !importanting everything?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When two selectors have the same "specificity", then the latter definition is used. That's the situation here. You can work around this without !important
s here by having a more specific selector -- like body .sd-card
(that increases the specificity by 1, which might just be enough). :)
Most of the conflicting styles here aren't !important
'd, so it's not a big deal. The issues I had with !important
in that library are around this file: https://github.com/executablebooks/sphinx-design/blob/cca2cfb1b4c0a55ecf6661889c52ea320d42f58f/style/_display.scss
Furo has a separate furo-extensions.css file that is loaded after the extensions, to deal with some of this -- but realistically, unless you're overriding !important
s (you're not, AFAICT), you can typically get away with a more specific selector. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ooh that is a great point. Can we try increasing the specificity just a bit to see if we can add these fixes without the "important" lines?
src/pydata_sphinx_theme/assets/styles/extensions/_sphinx_panels.scss
Outdated
Show resolved
Hide resolved
Co-authored-by: Chris Holdgraf <choldgraf@gmail.com>
Co-authored-by: Chris Holdgraf <choldgraf@gmail.com>
Co-authored-by: Chris Holdgraf <choldgraf@gmail.com>
I pushed a few minor changes to the docs:
I think the only thing remaining here is to see if we could remove some of the |
yep. I'm waiting for the ng-sphinx PR to be merged to use the new classes in the css files |
merge new basic-ng structure
@choldgraf ready for review, no more |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! This looks good to me, very happy there's no more !important
!
Is there a follow-up issue to get rid of sphinx-panels? I have not seen one yet. |
I don't think so, but agree we should deprecate it and switch to Sphinx design! |
Fix #627
as I'm still unable to build the doc on my machine, I'll use the draft to trigger the RDT build.
WIP