Skip to content

Commit

Permalink
Try to fix disabled folder not showing
Browse files Browse the repository at this point in the history
correct color for labels.

The devtools don't show any reason it wasn't
already working so this is a hack to get it to
work.
  • Loading branch information
greggman committed Dec 27, 2024
1 parent fe87e0f commit 92824cb
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
25 changes: 25 additions & 0 deletions examples/js/lots.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down Expand Up @@ -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');
Expand Down
4 changes: 4 additions & 0 deletions src/styles/muigui.css.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 92824cb

Please sign in to comment.