-
Notifications
You must be signed in to change notification settings - Fork 323
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 PST styling to version warning
button
#1700
Comments
This is a bit tricky; on the one hand, Sphinx does not have a native button directive (see executablebooks/sphinx-design#158). Thus, buttons in this theme (and, therefore, in On the other hand, this theme uses |
for me what is actionable about this issue is that |
Nope this makes sense considering that some of our core components rely on it. |
sphinx-design
a required dependency
FYI I changed the title of this issue to better reflect the actionable item |
I'm not a big fan of adding compulsory dependencies (specifically big ones like sphinx-design) as it also makes us dependent on there release cycle (never forget we were unable to use Sphinx 6 and 7 for a long time because of myst). why is it complicated to use a bootstrap button instead of sphinx-design classes? |
https://pydata-sphinx-theme.readthedocs.io/en/stable/user_guide/web-components.html
|
We supercharged them to make them compatible but we don't call them per se in the template components ? e.g. you can write a full documentation without |
ah, OK, I see what you mean. Off the top of my head IDK for sure, but after a quick search I think you are right that we don't actually rely on sphinx design for any components, except for the version warning button (the point of this issue). So yeah, I think another possible way forward would be
|
Similar to the issue reported in #1078, it derives from Sphinx and is designed to generate multiple outputs. In this case, there are no native nodes or directives for button elements in Sphinx. The components that we are calling "buttons" (in Sphinx design and PST by extension) are not buttons but links (if you inspect the code, you'll notice these are rendered as an Here comes the catch - when @gabalafou and I were discussing link-that-are-styled-like-buttons a while back, we argued that perhaps the only component that would warrant being a button was the version switcher but decided not to go down the route of adding a new component (at least at that time and because that would more than likely break things for a good amount of users). Now that we are discussing buttons and dependencies, I see two paths:
Where the component in question will remain a link-styled-as-a-button, we must ensure we provide the styling.
Either route would address both @12rambau 's concerns regarding adding another dependency and the situation where people do not want to add another plugin (namely sphinx-design) 🔗 Because links and buttons are different in purpose and implementation, I suggest reading this excellent resource for a friendly deep dive |
I was interpreting @12rambau's idea as "use bootstrap classes" (instead of sphinx-design classes) and not "make it a real HTML button". I think that path is fine here: it's already a "link-styled-as-button" and (as you point out @trallard) doesn't really behave like a button. Also the change shouldn't require any user intervention.
We did eventually go down that route: the version switcher dropdown is already a |
Right, so we are finishing the mega interactive states PR (#1564 - I reviewed the last PR yesterday and all is left now is some ci fixes), so we could perhaps sneak in a final PR to remove the Does this sound like a good course of action? |
works for me! |
That's exactly what I meant! So providing a special styling within our css is to me the best and easiest solution. |
sphinx-design
a required dependencyversion warning
button
Sorry I interpreted it as making it a full button. |
I think this was addressed by #1721, so closing. Feel free to reopen if I'm wrong! |
The "Switch to stable version" button seem to use some
sphinx_design
classes:sd-btn sd-btn-danger sd-shadow-sm sd-text-wrap font-weight-bold ms-3 my-1 align-baseline
. If I'm not mistaken, it seems that one must includesphinx_design
in the extension list to get thosesphinx_design
style sheets.Is it possible that we do not rely on the
sphinx_design
button, and use for instance a bootstrap button instead, or just plain text? (Since I thinksphinx_design
is only optional instead of mandatory).The text was updated successfully, but these errors were encountered: