Skip to content

Commit

Permalink
doc(): improve documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasGysemans committed Apr 13, 2021
1 parent aa801be commit 6a102f8
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,25 @@ The items have also specific options:

In order to use `fontawesome_icon`, make sure you've installed [Fontawesome](https://cdnjs.com/libraries/font-awesome) in your project.

## Customize the panel

You can change the style of the panel by modifying the CSS file. There are the main variables defined at the beginning of the file:

```css
:root {
--panel-background-color: #fff;
--panel-box-shadow: 0 0 4px rgba(204, 204, 204, 0.75);
--panel-width: 160px;
--panel-text-color: #404040;
--panel-hover-item-background-color: #f4f6fa;
--panel-hover-item-color: #385074;
--panel-icon-width: 13px;
--panel-separator-color: #dfe3eb;
}
```

For further modifications, you'll need to modify the CSS properties. Be careful not to modify the file too much at the risk of compromising the proper functioning of the panel.

## Digital Accessibility

Following the digital accessibility recommendations for this kind of panels, it is necessary to open or close the panel by clicking either the Enter or Space key. See <https://www.accede-web.com/en/guidelines/rich-interface-components/show-hide-panels/> for more information.
Expand Down
10 changes: 9 additions & 1 deletion src/panel-style.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
--panel-separator-color: #dfe3eb;
}

/* the pannel */
.jspanel {
box-sizing: border-box;
position: absolute;
Expand All @@ -19,13 +20,15 @@
width: var(--panel-width, 160px);
min-height: 50px;
height: auto;
visibility: visible;
visibility: visible; /* important */
}

/* Never change the visibility of the sign by yourself. */
.jspanel.panel-hidden {
visibility: hidden;
}

/* the list of items */
.jspanel ul {
list-style-type: none;
margin: 0;
Expand All @@ -36,6 +39,7 @@
align-items: center;
}

/* for each item */
.jspanel li {
width: 100%;
height: 30px;
Expand All @@ -52,6 +56,7 @@
color: var(--panel-hover-item-color, #385074);
}

/* the title of the item */
.jspanel li span {
pointer-events: none;
-webkit-user-select: none;
Expand All @@ -64,6 +69,7 @@
overflow: hidden;
}

/* img is an `icon`, i is a `fontawesome_icon` */
.jspanel li img,
.jspanel li i {
pointer-events: none;
Expand All @@ -74,11 +80,13 @@
margin-right: 10px;
}

/* the icon */
.jspanel li img {
width: var(--panel-icon-width, 13px);
height: auto;
}

/* for each separator */
.jspanel .jspanel-separator {
height: 1px;
width: 80%;
Expand Down

0 comments on commit 6a102f8

Please sign in to comment.