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

so... CSS Grids seem pretty amazing

I'm thinking of converting my tables based sheet over to a Grids based one. Really in the hope that this gives me better control over the sizes of the areas and the placement of content. Does Roll20 support nested grids? I ask because I think that way... 1 master grid for the whole page, and then sub-grids for the smaller areas / items.
1588504376
Andreas J.
Forum Champion
Sheet Author
Translator
Does Roll20 support nested grids? Pretty sure this is more about the browser than Roll20, try and see? I think only Firefox so far supports Nested Grids, while Chrome haven't. So while nested grids are cool and I was exited when Firefox started supporting it in December, it would still mean you can't rely on it to make sheets work for everyone. It will be fantastic for character sheet design, but don't think it's yet.
I have used grid successfully in some of the sheets I have made.
1588528034

Edited 1588528303
Andreas J.
Forum Champion
Sheet Author
Translator
Coal Powered Puppet said: I have used grid successfully in some of the sheets I have made. I think were talking about separate things.  Tuck S. mentioned nested grids & subgrid. I assumed he meant CSS sub grid, which is only supported by Firefox 71 and later, but not Chrome. CSS Grid is standard, but the subgrid specification is still experimental. What comes to using normal CSS Grid inside eachother(and not subgrids), I'm pretty sure I've done that more than once, and see no reason why it wouldn't work. That's why I jumped to conclude that the subgrid specification was what he was asking about.
1588528731
GiGs
Pro
Sheet Author
API Scripter
Yeah, setting aside subgrids, chrome works fine with nesting grids inside each other. I've done at least 3 levels of nesting.
1588530154

Edited 1588549643
Caden
Forum Champion
Sheet Author
API Scripter
Compendium Curator
I only use Grids now. You can nest Grids. They can get laggy if you nest too deeply, particularly in repeating fieldsets. This just takes a little practice getting use to it.  My sheets typically use inline-block for the top level columns due to 'stretching' that can be caused to columns by repeating sections. Then everything else is grids within grids.
Fantastic, thanks.I'll go make a mess now and see how it works.
1588559829
Richard T.
Pro
Marketplace Creator
Sheet Author
Compendium Curator
I've been trying to use flexbox layouts to make the sheets reasonably mobile-friendly. 
1588559985

Edited 1588560030
vÍnce
Pro
Sheet Author
Wow.  That's some real "yoga" in design.  Cool.
damn. That's nuts. Great job. I'm still struggling to put an image behind a grid. I have grid areas with text, and that's working. But I want to put an image behind the text... not getting it.
1588567962
Richard T.
Pro
Marketplace Creator
Sheet Author
Compendium Curator
Put the grid inside a <div> container that has the background maybe? 
1588568031
vÍnce
Pro
Sheet Author
Do you have a "wrapper" element that your grid sits in?  I'm thinking you can can use background-image:url(...) on a wrapper div, then use background:transparent  on your inner grid cells.
I have this html &lt;div class="sheet-contswitch"&gt; &lt;div class="item"&gt;&lt;input type="radio" class="sheet-switch" name="attr_section" value="all" checked&gt;&lt;span class="sheet-pagesections" class="item" &gt;All&lt;/span&gt;&lt;/div&gt; &lt;div class="item"&gt;&lt;input type="radio" class="sheet-switch" name="attr_section" value="personal"&gt;&lt;span class="sheet-pagesections" class="item" &gt;Personal Data&lt;/span&gt;&lt;/div&gt; &lt;div class="item"&gt;&lt;input type="radio" class="sheet-switch" name="attr_section" value="attributes"&gt;&lt;span class="sheet-pagesections"&gt;Attributes&lt;/span&gt;&lt;/div&gt; &lt;div class="item"&gt;&lt;input type="radio" class="sheet-switch" name="attr_section" value="goals"&gt;&lt;span class="sheet-pagesections"&gt;Goals&lt;/span&gt;&lt;/div&gt; &lt;div class="item"&gt;&lt;input type="radio" class="sheet-switch" name="attr_section" value="skills"&gt;&lt;span class="sheet-pagesections"&gt;Skills&lt;/span&gt;&lt;/div&gt; &lt;div class="item"&gt;&lt;input type="radio" class="sheet-switch" name="attr_section" value="combat"&gt;&lt;span class="sheet-pagesections"&gt;Combat and Equipment&lt;/span&gt;&lt;/div&gt; &lt;div class="item"&gt;&lt;input type="radio" class="sheet-switch" name="attr_section" value="favors"&gt;&lt;span class="sheet-pagesections"&gt;Favors&lt;/span&gt;&lt;/div&gt; &lt;div class="item"&gt;&lt;input type="radio" class="sheet-switch" name="attr_section" value="relationships"&gt;&lt;span class="sheet-pagesections"&gt;Relationships&lt;/span&gt;&lt;/div&gt; &lt;div class="item"&gt;&lt;input type="radio" class="sheet-switch" name="attr_section" value="vehicles"&gt;&lt;span class="sheet-pagesections"&gt;Vehicles&lt;/span&gt;&lt;/div&gt; &lt;div class="item"&gt;&lt;input type="checkbox" class="sheet-switch" name="attr_continuumdeets" value="1" style="opacity:1"&gt;&lt;/div&gt; &lt;div class="item"&gt;&lt;input type="checkbox" class="sheet-switch" name="attr_showmetabilities" value="1" style="opacity:1"&gt;&lt;/div&gt; &lt;div class="item paperlines"&gt;&lt;img src="<a href="https://blinkoz.s3.amazonaws.com/Clients/Blinxel/OtekuOtaku/Continuum/LinedPaperBG-04.png&quot;&gt;&lt;/div" rel="nofollow">https://blinkoz.s3.amazonaws.com/Clients/Blinxel/OtekuOtaku/Continuum/LinedPaperBG-04.png"&gt;&lt;/div</a>&gt; &lt;/div&gt; and I want that image in the last line to site behind all the other "cells" and stretch the entire width of the page. To create the illusion that this is lined note paper. The image is just a blue line in a 32x32 .png with no bg. Here's the CSS I have so far. .charsheet .sheet-contswitch { display: grid; grid-template-columns: fit-content(100px) fit-content(100px) fit-content(100px) fit-content(100px) fit-content(100px) fit-content(200px) fit-content(100px) fit-content(100px) fit-content(100px) auto auto; grid-template-rows: 32px; grid-gap: .25rem; } .charsheet .sheet-paperlines { grid-column: 2 / span 5; z-index: 10; } Any advice would be helpful.
1588568888
Richard T.
Pro
Marketplace Creator
Sheet Author
Compendium Curator
Just add this to your .sheet-contswitch CSS background: url('<a href="https://blinkoz.s3.amazonaws.com/Clients/Blinxel/OtekuOtaku/Continuum/LinedPaperBG-04.png" rel="nofollow">https://blinkoz.s3.amazonaws.com/Clients/Blinxel/OtekuOtaku/Continuum/LinedPaperBG-04.png</a>'); When you are using the &lt;img&gt; tag you are creating an item that by default lives with text and buttons. You are looking to set it to the background.&nbsp;
That appears to have done it. So simple. That's embaressing.
1588569286
Richard T.
Pro
Marketplace Creator
Sheet Author
Compendium Curator
We've all done it. Be grateful that the fix is simple.&nbsp;
I seem to have borked something real good. I've got this series of buttons across the top of my sheet that turn sections on and off. Here's the CSS. (I know this bit works) .charsheet .sheet-contswitch { display: grid; grid-template-columns: fit-content(100px) fit-content(100px) fit-content(100px) fit-content(100px) fit-content(100px) fit-content(200px) fit-content(100px) fit-content(100px) fit-content(100px) auto auto; grid-template-rows: 32px; grid-gap: 1rem; background: url('<a href="https://blinkoz.s3.amazonaws.com/Clients/Blinxel/OtekuOtaku/Continuum/LinedPaperBG-04.png" rel="nofollow">https://blinkoz.s3.amazonaws.com/Clients/Blinxel/OtekuOtaku/Continuum/LinedPaperBG-04.png</a>'); } table { border-collapse: collapse; border: 0x solid black; } @import url('<a href="https://fonts.googleapis.com/css?family=Pangolin&amp;display=swap" rel="nofollow">https://fonts.googleapis.com/css?family=Pangolin&amp;display=swap</a>'); /* Radio buttons to select section */ input.sheet-switch { display: inline; width: auto; justify-items: start; } .charsheet .sheet-pagesections { background-color: transparent; color: #0000cc; font-family: Pangolin; line-height: 34px; } input.sheet-switch[value="all"]:checked ~ div.sheet-personal, input.sheet-switch[value="all"]:checked ~ div.sheet-metabilities, input.sheet-switch[value="all"]:checked ~ div.sheet-attributes, input.sheet-switch[value="all"]:checked ~ div.sheet-goals, input.sheet-switch[value="all"]:checked ~ div.sheet-skills, input.sheet-switch[value="all"]:checked ~ div.sheet-combat, input.sheet-switch[value="all"]:checked ~ div.sheet-favors, input.sheet-switch[value="all"]:checked ~ div.sheet-relationships, input.sheet-switch[value="all"]:checked ~ div.sheet-vehicles { display: block; } input.sheet-toggle-show[value="0"] ~ div.sheet-continuum, input.sheet-toggle-show[value="0"] ~ div.sheet-yet, input.sheet-toggle-show[value="0"] ~ div.sheet-spanning, input.sheet-toggle-show[value="0"] ~ div.sheet-meta { display: none; } input.sheet-switch[value="personal"]:checked ~ div:not(.sheet-personal) { display: none; } input.sheet-switch[value="spanning"]:checked ~ div:not(.sheet-spanning) { display: none; } input.sheet-switch[value="metabilities"]:checked ~ div:not(.sheet-metabilities) { display: none; } input.sheet-switch[value="attributes"]:checked ~ div:not(.sheet-attributes) { display: none; } input.sheet-switch[value="goals"]:checked ~ div:not(.sheet-goals) { display: none; } input.sheet-switch[value="skills"]:checked ~ div:not(.sheet-skills) { display: none; } input.sheet-switch[value="combat"]:checked ~ div:not(.sheet-combat) { display: none; } input.sheet-switch[value="yet"]:checked ~ div:not(.sheet-yet) { display: none; } input.sheet-switch[value="favors"]:checked ~ div:not(.sheet-favors) { display: none; } input.sheet-switch[value="relationships"]:checked ~ div:not(.sheet-relationships) { display: none; } input.sheet-switch[value="vehicles"]:checked ~ div:not(.sheet-vehicles) { display: none; } /* end section selection*/ Now this is the old HTML, which works- &lt;/div&gt; &lt;input type="radio" class="sheet-switch" name="attr_section" value="all" checked&gt;All&amp;nbsp;&amp;nbsp; &lt;input type="radio" class="sheet-switch" name="attr_section" value="personal"&gt;Personal Data&amp;nbsp;&amp;nbsp; &lt;input type="radio" class="sheet-switch" name="attr_section" value="attributes"&gt;Attributes&amp;nbsp;&amp;nbsp; &lt;input type="radio" class="sheet-switch" name="attr_section" value="goals"&gt;Goals&amp;nbsp;&amp;nbsp; &lt;input type="radio" class="sheet-switch" name="attr_section" value="skills"&gt;Skills&amp;nbsp;&amp;nbsp; &lt;input type="radio" class="sheet-switch" name="attr_section" value="combat"&gt;Combat and Equipment&amp;nbsp;&amp;nbsp; &lt;input type="radio" class="sheet-switch" name="attr_section" value="favors"&gt;Favors&amp;nbsp;&amp;nbsp; &lt;input type="radio" class="sheet-switch" name="attr_section" value="relationships"&gt;Relationships&amp;nbsp;&amp;nbsp; &lt;input type="radio" class="sheet-switch" name="attr_section" value="vehicles"&gt;Vehicles&amp;nbsp;&amp;nbsp; &lt;input type="checkbox" class="sheet-switch" name="attr_continuumdeets" value="1" style="opacity:0"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;input type="checkbox" class="sheet-switch" name="attr_showmetabilities" value="1" style="opacity:0"&gt;&amp;nbsp;&amp;nbsp; &lt;div class="sheet-personal"&gt; &lt;h1 class="sheet-section"&gt;Personal Data&lt;/h1&gt; and so on... here's the new one, where I'm migrating to Grid... &lt;div class="sheet-contswitch"&gt; &lt;div class="item"&gt;&lt;input type="radio" class="sheet-switch" name="attr_section" value="all" checked&gt;&lt;span class="sheet-pagesections" class="item" &gt;All&lt;/span&gt;&lt;/div&gt; &lt;div class="item"&gt;&lt;input type="radio" class="sheet-switch" name="attr_section" value="personal"&gt;&lt;span class="sheet-pagesections" class="item" &gt;Personal Data&lt;/span&gt;&lt;/div&gt; &lt;div class="item"&gt;&lt;input type="radio" class="sheet-switch" name="attr_section" value="attributes"&gt;&lt;span class="sheet-pagesections"&gt;Attributes&lt;/span&gt;&lt;/div&gt; &lt;div class="item"&gt;&lt;input type="radio" class="sheet-switch" name="attr_section" value="goals"&gt;&lt;span class="sheet-pagesections"&gt;Goals&lt;/span&gt;&lt;/div&gt; &lt;div class="item"&gt;&lt;input type="radio" class="sheet-switch" name="attr_section" value="skills"&gt;&lt;span class="sheet-pagesections"&gt;Skills&lt;/span&gt;&lt;/div&gt; &lt;div class="item"&gt;&lt;input type="radio" class="sheet-switch" name="attr_section" value="combat"&gt;&lt;span class="sheet-pagesections"&gt;Combat and Equipment&lt;/span&gt;&lt;/div&gt; &lt;div class="item"&gt;&lt;input type="radio" class="sheet-switch" name="attr_section" value="favors"&gt;&lt;span class="sheet-pagesections"&gt;Favors&lt;/span&gt;&lt;/div&gt; &lt;div class="item"&gt;&lt;input type="radio" class="sheet-switch" name="attr_section" value="relationships"&gt;&lt;span class="sheet-pagesections"&gt;Relationships&lt;/span&gt;&lt;/div&gt; &lt;div class="item"&gt;&lt;input type="radio" class="sheet-switch" name="attr_section" value="vehicles"&gt;&lt;span class="sheet-pagesections"&gt;Vehicles&lt;/span&gt;&lt;/div&gt; &lt;div class="item"&gt;&lt;input type="checkbox" class="sheet-switch" name="attr_continuumdeets" value="1" style="opacity:1"&gt;&lt;/div&gt; &lt;div class="item"&gt;&lt;input type="checkbox" class="sheet-switch" name="attr_showmetabilities" value="1" style="opacity:1"&gt;&lt;/div&gt; &lt;/div&gt; I suspect it's to do with the&nbsp; &lt;div class="sheet-contswitch"&gt; but I'm not sure.