Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

CSS Styling with Stylus, getting around dark mode use of 'box-sizing: content-box'

1687555220

Edited 1687555321
Daniel S.
Pro
Marketplace Creator
Sheet Author
Compendium Curator
I use a CSS chrome script called 'Stylus', based on the recommendations of some folks on these forums. For awhile I was using something called 'Roll20 Tighter Sidebars'. The code is here. .dd-list .journalitem .name, .dd-list .library-item .name { top: 0px; } .dd-list .journalitem .token, .dd-list .library-item .token { top: 0px; } .dd-item .folder-title { background-color: #535353 !important; color: #fdf9eb; } .dd-content { padding: 0px; } #compendium .searchroot .dd-item .dd-content .token img { padding: 0px; max-width: 19px; max-height: 19px; } #compendium .searchroot .dd-item .dd-content .token { top: 0px; } #compendium .searchroot .dd-item .dd-content .sourcefooter { width: 18px; height: 18px; position: absolute; top: 0px; right: 0; font-size: 6px; } .expandcontroller { position: relative; bottom:10px; } #compendium .searchroot .dd-item .dd-content .sourcefooter { font-size: 12px; } .inapp .sourcefooter,.inapp.expansion3 .sourcefooter, .inapp.expansion9 .sourcefooter, .inapp.expansion13 .sourcefooter, .inapp.expansion16 .sourcefooter { background-size: 15px 10px; background-image:none; padding-top: 5px; top: 0px !important; } .dd-item, .dd-empty, .dd-placeholder { min-height: 21px; font-size: 12px; line-height: 20px; } .dd-list .handout img, .dd-list .archivetable img, .dd-list .journalitem img, .dd-list .library-item img{ max-width: 20px; max-height: 20px; } .dd-item&gt;button { height: 16px; margin: 0px; font-size: 14px; top: 0px; } .dd-handle { top: 0px; width: 20px; padding: 0px 10px; } However, with the dark mode update, you get a weird cascading list for unopened Folders in the journal tab. I scoured through the 'inspect' css styles, and tracked the problem down to a CSS property that's been applied to a bunch of things called "box-sizing: content-box". When unchecked, for some reason the lists go back to working normally with the extra Stylus styling. However, when unchecked, a number of other stylings get wonky as Roll20 uses that property for a number of other things. So my question is, is there a way to isolate that property for just the right sidebar, or would I have to turn it off globally? And can I do so with an external CSS thing like stylus and some !important property or something? Or does anyone know what might be causing that in the Stylus code? From what I could tell it had something to do with the properties applied to: .dd-item,&nbsp; .dd-empty, .dd-placeholder Thanks! Some screenshots of checked and unchecked 'box-sizing: content-box' <a href="https://www.dropbox.com/s/r9806rviuhps780/Screen%20Shot%202023-06-23%20at%205.02.02%20PM.png?dl=0" rel="nofollow">https://www.dropbox.com/s/r9806rviuhps780/Screen%20Shot%202023-06-23%20at%205.02.02%20PM.png?dl=0</a> <a href="https://www.dropbox.com/s/dzwgtgqrgsvivxv/Screen%20Shot%202023-06-23%20at%205.02.00%20PM.png?dl=0" rel="nofollow">https://www.dropbox.com/s/dzwgtgqrgsvivxv/Screen%20Shot%202023-06-23%20at%205.02.00%20PM.png?dl=0</a>
1687556347
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Hi Daniel! Use this for Tighter Sidebars now. I should go back and update those old styles. .rollabil.btn.dfontd20{ &nbsp; &nbsp; margin-right: 10px; &nbsp; &nbsp; font-size: 1.2em; &nbsp; &nbsp; color: black; &nbsp; &nbsp; padding: 0px; &nbsp; &nbsp; font-family:dicefontd20; } .attributesabilities&nbsp; { &nbsp; &nbsp; right: 0; &nbsp; &nbsp; top: 10px; &nbsp; &nbsp; width: auto; padding-left: 3px; &nbsp; &nbsp; background-color: #eee !important; &nbsp; &nbsp; &nbsp; &nbsp; margin-bottom: 2px; } #rightsidebar .paddedtable button { &nbsp; &nbsp; padding-top: 0px; &nbsp; &nbsp; padding-bottom: 0px; } .attributesabilities .abil { &nbsp; &nbsp; padding-top: 3px; &nbsp; &nbsp; padding-bottom: 1px; } .dd-list .journalitem .name, .dd-list .library-item .name { &nbsp; &nbsp; top: 0px; } .dd-list .journalitem .token, .dd-list .library-item .token { &nbsp; &nbsp; top: 0px; } .dd-item&nbsp; .folder-title { &nbsp; &nbsp; background-color: var( --dark-gray-disabled, #eee) !important; &nbsp; &nbsp; border-radius:0px; &nbsp; &nbsp; padding: 3px 0px 7px 0px; &nbsp; &nbsp; line-height:13px; &nbsp; &nbsp; } .dd-content { &nbsp; &nbsp; padding: 0px 0px 0px 0px!important; &nbsp; &nbsp; border-radius:0px; &nbsp; &nbsp;&nbsp; } .dd-content.static { &nbsp; &nbsp; padding-left: 3px !important; } .expandcontroller.down { &nbsp; &nbsp; color:transparent; } a#advancedSearch{ box-shadow:inset 0px 1px 0px 0px #f5978e; background:linear-gradient(to bottom, #f24537 5%, #c62d1f 100%); background-color:#f24537; border-radius:6px; border:1px solid #d02718; display:inline-block; color:#ffffff; padding:0px 5px; } #jukeboxfolderroot .playbackcontrol { &nbsp; &nbsp; margin-left: 18px; } #compendium .searchroot .dd-item .dd-content .token img { &nbsp; &nbsp; padding: 0px; &nbsp; &nbsp; max-width: 19px; &nbsp; &nbsp; max-height: 19px; } #compendium .searchroot .dd-item .dd-content .token { &nbsp; &nbsp; top: 0px; } #compendium .searchroot .dd-item .dd-content .sourcefooter { &nbsp; &nbsp; width:40px; &nbsp; &nbsp; &nbsp; &nbsp;height: 18px; &nbsp; &nbsp; position: absolute; &nbsp; &nbsp; top: 0px; &nbsp; &nbsp; right: 0px; &nbsp; &nbsp; font-size: 6px; } .expandcontroller { &nbsp; &nbsp; position: relative; &nbsp; &nbsp; bottom:10px; } #compendium .searchroot .dd-item .dd-content .sourcefooter { &nbsp; &nbsp; font-size: 12px; } .inapp .sourcefooter,.inapp.expansion3 .sourcefooter, .inapp.expansion9 .sourcefooter, .inapp.expansion13 .sourcefooter, .inapp.expansion16 .sourcefooter { &nbsp; &nbsp; background-size: 15px 10px; &nbsp; &nbsp; background-image:none; &nbsp; &nbsp; padding-top: 5px; &nbsp; &nbsp; top: 0px !important; } .dd-item, .dd-empty, .dd-placeholder { &nbsp; &nbsp; min-height: 21px; &nbsp; &nbsp; font-size: 12px; &nbsp; &nbsp; line-height: 20px; } .dd-list .handout img, .dd-list .archivetable img, .dd-list .journalitem img, .dd-list .library-item img{ &nbsp; &nbsp; max-width: 20px; &nbsp; &nbsp; max-height: 20px; } .dd-item&gt;button { &nbsp; &nbsp; height: 16px; &nbsp; &nbsp; margin: 0px; &nbsp; &nbsp; font-size: 14px; &nbsp; &nbsp; top: 0px; } .dd-handle { &nbsp; &nbsp; top: 0px; &nbsp; &nbsp; width: 20px; &nbsp; &nbsp; padding: 0px 10px; } .compendium-removed-expansions { &nbsp; &nbsp; background-color: var( --dark-gray-disabled, #fff) !important; &nbsp; &nbsp; border: none; &nbsp; &nbsp; border-radius: 4px; &nbsp; &nbsp; clear: both; &nbsp; &nbsp; padding: 0px; &nbsp; &nbsp; margin-bottom: 0px; &nbsp; &nbsp; font-style: italic; &nbsp; &nbsp; color: #aaa; } /*#recentuploads li::after[data-grid-width][data-grid-height][data-filesize]{ &nbsp; content: attr(data-grid-width) "x" attr(data-grid-height)", "attr(data-filesize); }*/ *#recentuploads li::after { &nbsp; &nbsp; background-color: var(--dark-surface1,white); &nbsp; &nbsp; content: attr(data-filesize); /*&nbsp; &nbsp; content: attr(data-grid-width) "x" attr(data-grid-height)", "attr(data-filesize);*/ &nbsp; &nbsp; display: inline-block; &nbsp; &nbsp; font-size: 0.8em; &nbsp; &nbsp; padding-left: 3px; &nbsp; &nbsp; position: absolute; &nbsp; &nbsp; right: 0; }
1687576156
Daniel S.
Pro
Marketplace Creator
Sheet Author
Compendium Curator
I'll try it out! Thanks!
1687577173
Daniel S.
Pro
Marketplace Creator
Sheet Author
Compendium Curator
Works great! Thanks! As someone who is trying to learn some CSS and get a little better over time, would you be willing to explain what changed to cause that cascading effect? It'd be much appreciated. Thanks!
1687579101
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
I don't honestly remember. :D I worked it out when Dark Mode was introduced a year and a half ago, and haven't thought about it much since then.
1687640313
Daniel S.
Pro
Marketplace Creator
Sheet Author
Compendium Curator
Haha fair enough. Thanks for the updated styling! Maybe I can dissect it and figure it out.