mirror of
https://github.com/picocss/pico.git
synced 2025-04-20 16:46:14 -04:00
Docs: Sidebar styles
This commit is contained in:
parent
7e02e9f959
commit
c71144455b
52 changed files with 247 additions and 159 deletions
|
@ -6,6 +6,7 @@
|
|||
*/
|
||||
|
||||
export const colorPicker = {
|
||||
|
||||
// Config
|
||||
colors: null,
|
||||
buttonsTarget: '#customization article[data-theme="generated"]',
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
*/
|
||||
|
||||
export const grid = {
|
||||
|
||||
// Config
|
||||
buttons: {
|
||||
text: {
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
*/
|
||||
|
||||
export const themeSwitcher = {
|
||||
|
||||
// Config
|
||||
_scheme: 'auto',
|
||||
change: {
|
||||
|
|
53
docs/js/src/toggle-navigation.js
Normal file
53
docs/js/src/toggle-navigation.js
Normal file
|
@ -0,0 +1,53 @@
|
|||
/*
|
||||
* Toggle navigation
|
||||
*
|
||||
* Pico.css - https://picocss.com
|
||||
* Copyright 2019-2021 - Licensed under MIT
|
||||
*/
|
||||
|
||||
export const toggleNavigation = {
|
||||
|
||||
// Config
|
||||
_state: 'closed-on-mobile',
|
||||
toggleLink: document.getElementById('toggle-docs-navigation'),
|
||||
nav: document.querySelector('main > aside > nav'),
|
||||
|
||||
// Init
|
||||
init() {
|
||||
this.onToggleClick()
|
||||
},
|
||||
|
||||
onToggleClick() {
|
||||
this.toggleLink.addEventListener(
|
||||
'click',
|
||||
function (event) {
|
||||
event.preventDefault();
|
||||
if (this.state == 'closed-on-mobile') {
|
||||
this.state = 'open';
|
||||
} else {
|
||||
this.state = 'closed-on-mobile';
|
||||
}
|
||||
this.nav.removeAttribute('class');
|
||||
this.nav.classList.add(this.state);
|
||||
}.bind(this),
|
||||
false
|
||||
);
|
||||
},
|
||||
|
||||
// Apply navigation state
|
||||
applyState() {
|
||||
|
||||
},
|
||||
|
||||
// Get state
|
||||
get state() {
|
||||
return this._state;
|
||||
},
|
||||
|
||||
// Set state
|
||||
set state(state) {
|
||||
this._state = state;
|
||||
},
|
||||
};
|
||||
|
||||
export default toggleNavigation;
|
Loading…
Add table
Add a link
Reference in a new issue