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

Applying classes to rolltemplates

1585640354
Richard T.
Pro
Marketplace Creator
Sheet Author
Compendium Curator
I decided to try to simplify some of my CSS for roll templates and I can't tell if I'm being a dunce or if there's an existing obstacle that's specific to roll templates.&nbsp; Trying to avoid my css with a lot of listed classes: .sheet-rolltemplate-attack .inlinerollresult.fullfail, .sheet-rolltemplate-generic .inlinerollresult.fullfail, .sheet-rolltemplate-ability .inlinerollresult.fullfail, .sheet-rolltemplate-initiative .inlinerollresult.fullfail { &nbsp; &nbsp; color: #0099cc; &nbsp; &nbsp; border: none; /*Cool Gray 6 C*/ &nbsp; &nbsp; background:none; } Instead I'm trying to nest a simple div under the roll template to kick off a basic package of styling: &lt;rolltemplate class="sheet-rolltemplate-defend"&gt; &lt;div class="combatroller"&gt; &nbsp; &nbsp; &nbsp; &nbsp; &lt;table&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;tr&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;th colspan="2"&gt;{{name}}&lt;/th&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/tr&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {{#defend}} &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;tr&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td data-i18n="defend-rt"&gt;Defend&lt;/td&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td&gt;{{defend}}&lt;/td&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/tr&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {{/defend}} &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {{#attack}} &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;tr&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td&gt;&lt;div style="text-align:center;" data-i18n="attack"&gt;Attack&lt;/div&gt;&lt;/td&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td&gt;&lt;div style="text-align:center;"&gt;{{attack}}&lt;/div&gt;&lt;/td&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/tr&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;tr&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td&gt;&lt;div style="text-align:center;" data-i18n="damage"&gt;Damage&lt;/div&gt;&lt;/td&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td&gt;&lt;div style="text-align:center;"&gt;{{damage}}&lt;/div&gt;&lt;/td&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/tr&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {{/attack}} &nbsp; &nbsp; &nbsp; &nbsp; &lt;/table&gt; &lt;/div&gt; &nbsp; &nbsp; &lt;/rolltemplate&gt; But my css is not applying at all.... .sheet-combatroller table { &nbsp; &nbsp; width: 235px; &nbsp; &nbsp; background: url(<a href="https://raw.githubusercontent.com/Roll20/roll20-character-sheets/master/Ars_Magica_5th/images/combatroller_bg2.jpg" rel="nofollow">https://raw.githubusercontent.com/Roll20/roll20-character-sheets/master/Ars_Magica_5th/images/combatroller_bg2.jpg</a>), white; &nbsp; &nbsp; color: #cccc99; &nbsp; &nbsp; font-size: 1.5em; &nbsp; &nbsp; font-family: 'Macondo', cursive; font-variant:small-caps; &nbsp; &nbsp; text-align:center; &nbsp; &nbsp; border-top-left-radius:10px; &nbsp; &nbsp; border-top-right-radius:10px; &nbsp; &nbsp; box-shadow: 0px 0px 4px black; } I feel like this should be super simple but... its being dumb.&nbsp;
1585641181

Edited 1585641234
vÍnce
Pro
Sheet Author
Have you tried including the roll template's class as well? .sheet-rolltemplate-defend .sheet-combatroller table { &nbsp; &nbsp; width: 235px; &nbsp; &nbsp; background: url(<a href="https://raw.githubusercontent.com/Roll20/roll20-character-sheets/master/Ars_Magica_5th/images/combatroller_bg2.jpg" rel="nofollow">https://raw.githubusercontent.com/Roll20/roll20-character-sheets/master/Ars_Magica_5th/images/combatroller_bg2.jpg</a>), white; &nbsp; &nbsp; color: #cccc99; &nbsp; &nbsp; font-size: 1.5em; &nbsp; &nbsp; font-family: 'Macondo', cursive; &nbsp; &nbsp; font-variant:small-caps; &nbsp; &nbsp; text-align:center; &nbsp; &nbsp; border-top-left-radius:10px; &nbsp; &nbsp; border-top-right-radius:10px; &nbsp; &nbsp; box-shadow: 0px 0px 4px black; }
1585641856
Richard T.
Pro
Marketplace Creator
Sheet Author
Compendium Curator
I would be upset if that was necessary since that'd be defeating the purpose of my generic class D:&nbsp;
1585642285
vÍnce
Pro
Sheet Author
Richard T. said: I would be upset if that was necessary since that'd be defeating the purpose of my generic class D:&nbsp; I believe that's how I've always done them...
1585642547
Richard T.
Pro
Marketplace Creator
Sheet Author
Compendium Curator
Yeah, I was trying to figure out if this situation was simply a rolltemplate problem. Its kinda the point of CSS to apply general styling and not having to identify specific elements. T_T
1585642856
GiGs
Pro
Sheet Author
API Scripter
You do need to include the rolltemplate class unfortunately.
1585646207
Richard T.
Pro
Marketplace Creator
Sheet Author
Compendium Curator
Thanks for confirming, guys. I will disappointingly put back my lists.&nbsp;
1585649332
GiGs
Pro
Sheet Author
API Scripter
I think it is this way, because of the way roll20 pages are complete. Class names could easily be shared between elements of the character shet and the rolltemplate, not to mention roll20's native styles. Since rolltemplates are printed out into chat, rogue classes could have unpredictable effects on the chat display or the roll20 interface itself, so they have to be sandboxed to make sure they only apply with the confines of the rolltemplate.