diff --git a/examples/js/lots.js b/examples/js/lots.js index bea3566..da31e58 100644 --- a/examples/js/lots.js +++ b/examples/js/lots.js @@ -47,6 +47,8 @@ const getListOfUIColorCSSVariableNames = (() => { })(); getListOfUIColorCSSVariableNames(); +const range = (n, fn) => new Array(n).fill(0).map((_, i) => fn(i)); + // eslint-disable-next-line no-constant-condition if (false) { const s = { @@ -228,6 +230,29 @@ if (showUI) { } +if (showUI) { + const div = document.createElement('div'); + uiElem.appendChild(div); + const gui = new GUI({parent: div, title: 'Disabled Folder'}); + + const folders = range(3, (i) => { + const settings = { + name: 'test', + speed: 45, + toggle: true, + animal: 'bird', + }; + const folder = gui.addFolder(`folder:${i}`); + folder.add(settings, 'name'); + folder.add(settings, 'speed', 0, 100); + folder.add(settings, 'toggle'); + folder.add(settings, 'animal', ['bird', 'cat', 'dog']); + return folder; + }); + + folders[1].enable(false); +} + // Using Sliders if (showUI) { const div = document.createElement('div'); diff --git a/src/styles/muigui.css.js b/src/styles/muigui.css.js index 876733d..e96dff2 100644 --- a/src/styles/muigui.css.js +++ b/src/styles/muigui.css.js @@ -150,6 +150,10 @@ export default { --value-color: var(--disabled-color) !important; --range-left-color: var(--disabled-color) !important; } +/* this shouldn't be needed! */ +.muigui-disabled label { + color: var(--disabled-color) +} .muigui canvas, .muigui svg {