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

Furo: ensure it properly formats custom directives #327

Closed
Eric-Arellano opened this issue May 12, 2023 · 0 comments · Fixed by #434
Closed

Furo: ensure it properly formats custom directives #327

Eric-Arellano opened this issue May 12, 2023 · 0 comments · Fixed by #434
Assignees
Milestone

Comments

@Eric-Arellano
Copy link
Collaborator

Eric-Arellano commented May 12, 2023

See #326. This will be tricky because it's using CSS classes from Bootstrap that we won't have in Furo. We may need to have multiple CSS classes, a set of Furo classes and a set of Pytorch classes.

Another possibility is to use Web Components to implement these directives.

@Eric-Arellano Eric-Arellano added this to the Furo milestone May 12, 2023
Eric-Arellano added a commit that referenced this issue May 16, 2023
)

Closes #323. These
are used by several Qiskit projects, so we should de-duplicate them.

![Screenshot 2023-05-16 at 10 02 55
AM](https://github.com/Qiskit/qiskit_sphinx_theme/assets/14852634/9c672417-6451-4547-bc36-10709f7f3880)


## Alternative considered: stop using these elements


For example, these elements will be somewhat tricky to get working with
Furo: #327.

We considered removing these design elements and instead using standard
Sphinx. For example, rather than having `qiskit-call-to-action-item`
with its clickable button to go to a URL, we could instead rely on
normal Sphinx links, or the left table of contents, and decide we don't
care about the button.

We decided that we like these design elements enough to keep them. It
would be a UX regression to remove them. We may want to improve the
styling—but we will still need the RST directive. We may also remove
these directives in some future, but only after finding a better
alternative.

---------

Co-authored-by: Abby Mitchell <[email protected]>
@Eric-Arellano Eric-Arellano self-assigned this Jun 2, 2023
Eric-Arellano added a commit that referenced this issue Jun 23, 2023
…tive (#415)

With `qiskit-card-item`, we expected you to have raw HTML in your RST
file with specific CSS classes so that everything would work correctly.
That was an antipattern, and not necessary since a card is an
independent visual unit that doesn't depend on its siblings.

Now, users only specify `qiskit-card` in their RST.

This PR also simplifies the HTML and CSS structure for the element:

* Removes unused CSS classes.
* Removes the `tags` option for the directive. It was unused in
production.
* Renames CSS classes to use the format `qiskit-card-x`.
* Moves all CSS into our custom classes, rather than using generic
classes like `.card-body` that won't exist in Furo.

This will make #327
simpler.

Before:

![before](https://github.com/Qiskit/qiskit_sphinx_theme/assets/14852634/7a944ec5-2309-44f7-859f-22f1ca987587)

After (my viewport changes a little):


![after](https://github.com/Qiskit/qiskit_sphinx_theme/assets/14852634/64d9f7b1-8851-42a5-ab98-c98ba948d678)
Eric-Arellano added a commit that referenced this issue Jun 29, 2023
Part of #327.

We use the same general design as Pytorch, but with several
improvements:

* The image stays a fixed size so that the aspect ratio is respected
better and it doesn't constantly shrink and expand.
* Uses flexbox rather than media queries. This results in a much
smoother experience when resizing the screen.
* Gets rid of a weird black overlay we were putting over the image.
Instead, now we set opacity to 0.7 when not highlighted.
* Adds a border so that there is a more distinct flat design.

Pytorch design:

![pytorch-cards](https://github.com/Qiskit/qiskit_sphinx_theme/assets/14852634/9682efc1-664e-40bd-91c6-f49b06005188)
Eric-Arellano added a commit that referenced this issue Jun 30, 2023
Closes #327.

This uses an extremely similar style to Pytorch:


![pytorch-cats](https://github.com/Qiskit/qiskit_sphinx_theme/assets/14852634/8df4e519-b09d-4cac-ae88-23e2fa693a72)

It's main change is using our color variables. The padding is also a
little less intense.

The icon implementation is awkward, but I couldn't figure out how to
reuse the icon from `icons.html` easily because we still need to support
Pytorch. So, I went with this implementation and opened
#433 to improve it
once we drop Pytorch.
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

Successfully merging a pull request may close this issue.

1 participant