Skip to content

Instantly share code, notes, and snippets.

View robindotis's full-sized avatar
😎

Robin robindotis

😎
View GitHub Profile
@robindotis
robindotis / theme.js
Last active March 3, 2023 08:37
Theme picker, using object oriented code
/*
* OORSSS: Object oriented really simple stylesheet switcher
*
* This script will generate buttons to switch stylesheets.
* It will use localstorage to store the users choice between sessions.
*
* STEP 1
* ======
* To get started you need to create a new themePicker, providing:
* - the id of the element within which the picker will be created [Required]
@robindotis
robindotis / style-switcher.js
Last active December 19, 2022 15:54
Really simple stylesheet switcher (RSSS)
/*
* RSSS: Really simple stylesheet switcher
*
* This script will generate buttons to switch stylesheets.
* It will use localstorage to store the users choice between sessions.
*
* Three variables need to be defined:
* - themeCss: Array of the available stylesheets. The first
* item in the array is the default style and
* should already exist in HEAD of the page as