4 ms·
I tend to build all my DOM in object oriented javascript, and always give the root element of a UI component the same class name as the name of the JavaScript c
by marcuswestin 16y ago
I tend to build all my DOM in object oriented javascript, and always give the root element of a UI component the same class name as the name of the JavaScript class. See eg https://github.com/marcuswestin/Focus/blob/master/js/ui/panels/LeftPanel.js https://github.com/marcuswestin/Focus/blob/master/js/ui/pane.... The CSS selectors then mirror the structure of thr JavaScript files as well as the hierarchy of the resulting UI.