Skip to content

Commit

Permalink
✨ Add dropdowns and icons
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisjsewell committed Jul 22, 2021
1 parent 7270ba1 commit 47f6796
Show file tree
Hide file tree
Showing 16 changed files with 691 additions and 9 deletions.
2 changes: 2 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,5 @@ include README.md

include sphinx_design/py.typed
include sphinx_design/compiled/style.min.css
include sphinx_design/compiled/opticon_LICENSE
include sphinx_design/compiled/opticons.json
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ This package is an iteration on sphinx-panels and intends to replace it.

## TODO

note that directly using classes should be used as a "last resort",
and to please open an issue if you find you are commonly using a certain class.

grids items cannot contain headers, is this in anyway possible with docutils structure?

- directives:
- dropdowns (optional), dropdown
- tabs (optional), tab
Expand All @@ -58,3 +63,5 @@ horizontal card (grid row inside card, picture on left)
avatars (rounded images)

horizontally scrollable cards: (see <https://stackoverflow.com/questions/35993300/horizontally-scrollable-list-of-cards-in-bootstrap>)

align icon and text in dropdown title
105 changes: 105 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,64 @@ next paragraph 1

::::

### Nested grids

::::::{grid}
:columns: 1 1 2 2
:gutter: 1

:::::{grid-item}

::::{grid}
:columns: 1 1 1 1
:gutter: 1

:::{grid-item-card}

{{ loremipsum }}

:::

:::{grid-item-card}

B

:::

::::

:::::

:::::{grid-item}

::::{grid}
:columns: 1 1 1 1
:gutter: 1

:::{grid-item-card}

C

:::

:::{grid-item-card}

D

:::

:::{grid-item-card}

E

:::

::::

:::::

::::::

(badges)=

## Badges
Expand Down Expand Up @@ -167,3 +225,50 @@ Button text
```

:::

## Dropdown

:::{dropdown} Dropdown title
Dropdown content
:::

:::{dropdown}
Dropdown content
:::

::::{dropdown} Parent dropdown title (open by default)
:open:

:::{dropdown} Child dropdown title
:color: warning
:icon: alert

Dropdown content
:::
::::

### Dropdowns in a grid

:::::{grid}
:columns: 1 1 2 2
:gutter: 1

::::{grid-item}
:::{dropdown} Dropdown title
Dropdown content
:::
::::

::::{grid-item}
:::{dropdown} Dropdown title
Dropdown content
:::
::::

:::::

## Icons

Some {opticon-16}`report;sd-text-info` middle {opticon-24}`report` more text

{fas}`spinner;sd-bg-primary sd-bg-text-primary fa-2x`
3 changes: 1 addition & 2 deletions sphinx_design/cards.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,7 @@ def create_card(
card_classes = ["sd-card", "sd-sphinx-override"]
if "width" in options:
card_classes += [f'sd-w-{options["width"]}']
if "margin" in options:
card_classes += options["margin"]
card_classes += options.get("margin", ["sd-mb-3"])
if "no-shadow" not in options:
card_classes += ["sd-shadow"]
if "hover" in options:
Expand Down
21 changes: 21 additions & 0 deletions sphinx_design/compiled/opticon_LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2021 GitHub Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
1 change: 1 addition & 0 deletions sphinx_design/compiled/opticons.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion sphinx_design/compiled/style.min.css

Large diffs are not rendered by default.

Loading

0 comments on commit 47f6796

Please sign in to comment.