Skip to content

Commit

Permalink
Hide buttons on smaller screens (mobile).
Browse files Browse the repository at this point in the history
See jupyterlite#140, we might want to also add a warning dialog from Javascript as
well in a subsequent PR.
  • Loading branch information
Carreau committed Feb 29, 2024
1 parent dff6da7 commit a473be8
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
5 changes: 5 additions & 0 deletions docs/directives/try_examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ Below is an example of the directive in use. The button has been styled with cus
css as explained in the configuration section below. Without custom css, the button will
be plain and unadorned.

Note that as starting JupyterLite can download a significant amount of data, and
that the Jupyter interface is not optimized for mobile, the buttons will be
hidden on mobile by default (screen width 430px or smaller). This can be
changed by overwriting with custom CSS.


```rst
Examples
Expand Down
11 changes: 11 additions & 0 deletions jupyterlite_sphinx/jupyterlite_sphinx.css
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,14 @@
@keyframes l13{
100%{transform: rotate(1turn)}
}



/* we do not want the button to show on smaller screens (phones), as clicking
* can download a lot of data, 430px, is the width of iPhone 14 pro max */

@media (max-width: 430px) {
div.try_examples_button_container {
display: none;
}
}

0 comments on commit a473be8

Please sign in to comment.