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 .
×
Advertisement Create a free account

Is the sheet- prefix necessary?

1618976659
kim
Pro
I am creating a custom character sheet. According to the  Sheet Development Wiki  I need to prefix classes with "sheet-" in CSS but not in HTML (since it's added automatically). I don't think this is actually happening since it works with and without the prefix as long as class names match between CSS and HTML. This works: <div class="sheet-example"></div> .sheet-example { ... } This also works: <div class="example"></div> .example { ... } This does not work: <div class="example"></div> .sheet-example { ... } Am I missing something? Thank you.
1618977776

Edited 1618978408
vÍnce
Pro
Sheet Author
Roll20 recently released the Character Sheet Enhancement update.  So basically you have legacy mode or CSE mode.  In legacy mode ("legacy":true in the sheet.json or toggle the “Legacy Sanitization” checkbox from a custom sheet settings page.), sheet's should act like they always have.  CSE mode does not require the ".sheet-"/"sheet-" in css or html class names (EXCEPT for roll templates, which still require it in css and html). So it depends on what mode are you designing for...   Legacy: (don't forget to enable it) include ".sheet-"/"sheet-" in css and roll template html.  Regular html it's optional. CSE: exclude "sheet-"/".sheet-" in css and html except for roll templates. Again, I believe it's optional in the regular html.  Meaning I don't think it will break anything if included.
1618978272
kim
Pro
Thank you for answering, vince. I did not set legacy to true so I assume I am on CSE. That explains it! I think I will stay on CSE since I prefer it that way and fix my code. 
1618978431
vÍnce
Pro
Sheet Author
CSE is the future. ;-)
1619005373

Edited 1619006084
Andreas J.
Forum Champion
Sheet Author
Translator
I think I will stay on CSE since I prefer it that way and fix my code. You 100% should, it's the future, as Vince said. Regarding the char sheet dev wiki documentation First and foremost, DO NOT use the Help Center sheet Documentation, it's massively outdated Use &amp; read the Community Wiki Sheet dev documentation, Starting page: <a href="https://wiki.roll20.net/Building_Character_Sheets" rel="nofollow">https://wiki.roll20.net/Building_Character_Sheets</a> Case in point, had you been reading the Community Wiki pages, you wouldn't have needed to ask about it, as the Legacy Sheet/ CSE differences are spelled out, at least when it comes to the sheet- stuff. The wiki isn't completely updated to be clear when " legacy sheet " examples are used and how CSE -sheets can be done, but I've added several warnings to most pages that might be affected. For example in this section <a href="https://wiki.roll20.net/BCS#Common_Mistakes" rel="nofollow">https://wiki.roll20.net/BCS#Common_Mistakes</a> , I've clarified that this applies only to Legacy sheets. One of the best sections currently are <a href="https://wiki.roll20.net/BCS#Restrictions" rel="nofollow">https://wiki.roll20.net/BCS#Restrictions</a> , as the restrictions for Legacy Sheets and CSE are separated, and the sheet- parts have been removed from the CSE sections. Would be great if others would help me start updating the sheet dev pages to have the code examples first show CSE-compliant examples, and maybe move the Legacy Sheet example code into collapsible sections. The " Tabs" CSS Wizardry section showcases how old &amp; new code can be kept side by side, one could press "Edit" for the section and copy the wikicode/syntax for the collapsed "old code" portion, and reuse it's format when updating other parts of the wiki.