Character Vault
Any Concept / Any System
Compendium
Your System Come To Life
Roll20 for Android
Streamlined for your Tablet
Roll20 for iPad
Streamlined for your Tablet

Personal tools

Difference between revisions of "Legacy Sheet Sanitization"

From Roll20 Wiki

Jump to: navigation, search
m (Using a Legacy Sheet)
m
 
Line 18: Line 18:
  
  
==Legacy Sheet Restrictions==</noinclude>
+
==Legacy Sheet Restrictions==
 +
See Also '''[[BCS/Bugs]]''' for newly rapported issues & bugs.
 +
</noinclude>
 
'''HTML:'''
 
'''HTML:'''
  
Line 27: Line 29:
 
* HTML Elements that doesn't work: <code><section></code>, <code><header></code>, <code><footer></code>, <code><a></code>, <code><meter></code>, <code><progress></code>, <code><datalist></code>, <code><details></code>, <code><summary></code>. Trying to add any of these to a sheet will either result in Roll20 removing them or behave like they are a <code><nowiki><div></nowiki></code>.
 
* HTML Elements that doesn't work: <code><section></code>, <code><header></code>, <code><footer></code>, <code><a></code>, <code><meter></code>, <code><progress></code>, <code><datalist></code>, <code><details></code>, <code><summary></code>. Trying to add any of these to a sheet will either result in Roll20 removing them or behave like they are a <code><nowiki><div></nowiki></code>.
 
* Attribute names are case-insensitive when checked for uniqueness. All <code><input></code>, <code><select></code>, <code><textarea></code> etc. should have unique attribute names if intended to be independent. Two inputs with same attr name will mirror each other and update if the other one is changed.
 
* Attribute names are case-insensitive when checked for uniqueness. All <code><input></code>, <code><select></code>, <code><textarea></code> etc. should have unique attribute names if intended to be independent. Two inputs with same attr name will mirror each other and update if the other one is changed.
* To create a section where you can dynamically add new entries, the [[Building_Character_Sheets#Repeating_Sections|Repeating Sections]] method is used through the <code><fieldset></code> element.
+
* To create a section where you can dynamically add new entries, the [[Repeating_Sections#Restrictions|Repeating Sections]] method is used through the <code><fieldset></code> element.
* <code><input></code> and <code><button></code> elements are restricted to a limited number of types(listed later in the guide). This is likely true with other elements.
+
* <code><input></code>([[Building_Character_Sheets#Text_.26_Numbers|inputs]]) and <code><button></code>([[Button]]) elements are restricted to a limited number of types. This is likely true with other elements.
* All CSS classes referenced in the HTML that don't start with <code>attr_</code>, <code>repeating_</code>, <code>roll_</code> or <code>sheet-</code>, will be prefixed with <code>sheet-</code> automatically when rendered in Roll20. The <code>sheet-</code> prefix is only required on the CSS file.
+
* All CSS classes referenced in the HTML that don't start with <code>attr_</code>, <code>repeating_</code>, <code>roll_</code> or <code>sheet-</code>, will be prefixed with <code>sheet-</code> automatically when rendered in Roll20. The <code>sheet-</code> prefix is only required on the CSS file, except for roll templates which needs them in the html.
* All images will be passed through the Roll20 image proxy to prevent security attacks. This should be largely transparent to you and shouldn't affect anything, but it's something to be aware of.
+
* All [[Image_use_in_character_sheets|images]] will be passed through the Roll20 image proxy to prevent security attacks. This should be largely transparent to you and shouldn't affect anything, but it's something to be aware of.
* <code><svg></code>-tag isn't supported directly, but there are ways to use <code>.svg</code> files, [https://github.com/Roll20/roll20-character-sheets/blob/94b205a0a7aab896fd10fcf7fa362fce41c83908/DD5thEditionLegacy/5th%20Edition%20Legacy.css#L4661 Example]
+
* <code><svg></code>-tag isn't supported directly, but there are ways to use <code>.svg</code> files, {{repo|Roll20/roll20-character-sheets/blob/94b205a0a7aab896fd10fcf7fa362fce41c83908/DD5thEditionLegacy/5th%20Edition%20Legacy.css#L4661 Example}}
 
* All attributes in [[Building_Character_Sheets/Roll_Templates|Roll Templates]] need to be written with double quotes, as single quotes results in roll template code being completely ignored.
 
* All attributes in [[Building_Character_Sheets/Roll_Templates|Roll Templates]] need to be written with double quotes, as single quotes results in roll template code being completely ignored.
 
* You can't refer to external CSS stylesheets, everything need to be on the CSS file
 
* You can't refer to external CSS stylesheets, everything need to be on the CSS file
Line 42: Line 44:
 
* Do not use <code>.sheet-new-window</code> as a CSS class name, as Roll20 already uses it and will block you from trying to override it. [https://app.roll20.net/forum/post/8618852/css-compiler-error-with-new-window-class/ Forum thread]
 
* Do not use <code>.sheet-new-window</code> as a CSS class name, as Roll20 already uses it and will block you from trying to override it. [https://app.roll20.net/forum/post/8618852/css-compiler-error-with-new-window-class/ Forum thread]
 
* Roll20 have some predefined CSS classes for it's [[Designing_Character_Sheet_Layout#Roll20_columns.2Frows|custom row/column system]] and other default, so very generic class names like: <code>.sheet-row</code>, <code>.sheet-col</code>, <code>3colrow</code>, <code>2colrow</code> and <code>.sheet-character</code> is best to be avoided.
 
* Roll20 have some predefined CSS classes for it's [[Designing_Character_Sheet_Layout#Roll20_columns.2Frows|custom row/column system]] and other default, so very generic class names like: <code>.sheet-row</code>, <code>.sheet-col</code>, <code>3colrow</code>, <code>2colrow</code> and <code>.sheet-character</code> is best to be avoided.
* [[Building_Character_Sheets#Repeating_Sections|Repeating sections Restrictions]]
+
* [[Repeating_Sections#Restrictions|Repeating Sections Restrictions]]
 
* '''Default Fonts:''' The following fonts can be accessed by default: <code>Arial</code>, <code>Patrick Hand</code>, <code>Contrail One</code>, <code>Shadows Into Light</code> and <code>Candal</code>
 
* '''Default Fonts:''' The following fonts can be accessed by default: <code>Arial</code>, <code>Patrick Hand</code>, <code>Contrail One</code>, <code>Shadows Into Light</code> and <code>Candal</code>
 
* '''[[#Google Fonts|Google Fonts]]:''' can be used with the <code>@import</code>-function ['''Note:''' If you use <code>@import</code> with Google’s own generated URL, you may see the following error: <code>Potential CSS security violation; character sheet template styling thrown out.</code> To work around this issue, change <code>css2?family</code> to <code>css?family</code> in the URL (i.e., remove the “<code>2</code>”).]
 
* '''[[#Google Fonts|Google Fonts]]:''' can be used with the <code>@import</code>-function ['''Note:''' If you use <code>@import</code> with Google’s own generated URL, you may see the following error: <code>Potential CSS security violation; character sheet template styling thrown out.</code> To work around this issue, change <code>css2?family</code> to <code>css?family</code> in the URL (i.e., remove the “<code>2</code>”).]

Latest revision as of 15:59, 5 May 2021

Main Page: Building Character Sheets

Character Sheet Creation
Getting Started


Reference


Tools & Tips


Git/GitHub GitHubLogo.png


Other


Legacy Sheet Sanitization ( or LCS, Legacy Character Sheets) refers to the older and more restricted method used for creating custom character sheets that was the only mode for sheets until March 2021 when CSE was revealed.


Considering the GitHubLogo.png consists of +850 character sheets, which have been created between 2015 & 2021, a majority of them will likely remain Legacy Sheets for a good while, so looking at existing sheets. Most or all sheet examples on the wiki are made for Legacy Sheets, unless otherwise stated.

Character Sheet Enhancement(CSE) is the new sheet creation method released March 2021, with new features and less restrictions than Legacy Sheets. Legacy Sheets are not compatible with CSE straight away, and need to be adjusted first. Check the CSE page for more info.

Contents


[edit] Using a Legacy Sheet

If you copy the source code of a Legacy sheet and save it either using the Sheet Editor, you need to check the box for "legacy sanitation", otherwise the editor assumes you have CSE-compatible code.

Check the box if you want to use (older) legacy code.

Using the Sheet Sandbox, you need to add a sheet.json-file that includes the "legacy":true line. See more on Sheet_Sandbox#Sheet.json_Editor


[edit] Legacy Sheet Restrictions

See Also BCS/Bugs for newly rapported issues & bugs.

HTML:

In the Roll20, the character sheet code is basically wrapped inside a giant <form> tag(so don't use it).

  • Id attributes cannot be used. (Any ID attributes on one character's sheet would affect another character's sheet in the same campaign when opened)
  • Any DOM functionalities can't be used
  • Do not use Root HTML elements such as <html> <head>, <title>, or <body> which are used to in your HTML. Doing so will prevent your character sheet from loading in the virtual tabletop.
  • HTML Elements that doesn't work: <section>, <header>, <footer>, <a>, <meter>, <progress>, <datalist>, <details>, <summary>. Trying to add any of these to a sheet will either result in Roll20 removing them or behave like they are a <div>.
  • Attribute names are case-insensitive when checked for uniqueness. All <input>, <select>, <textarea> etc. should have unique attribute names if intended to be independent. Two inputs with same attr name will mirror each other and update if the other one is changed.
  • To create a section where you can dynamically add new entries, the Repeating Sections method is used through the <fieldset> element.
  • <input>(inputs) and <button>(Button) elements are restricted to a limited number of types. This is likely true with other elements.
  • All CSS classes referenced in the HTML that don't start with attr_, repeating_, roll_ or sheet-, will be prefixed with sheet- automatically when rendered in Roll20. The sheet- prefix is only required on the CSS file, except for roll templates which needs them in the html.
  • All images will be passed through the Roll20 image proxy to prevent security attacks. This should be largely transparent to you and shouldn't affect anything, but it's something to be aware of.
  • <svg>-tag isn't supported directly, but there are ways to use .svg files, GitHubLogo.png
  • All attributes in Roll Templates need to be written with double quotes, as single quotes results in roll template code being completely ignored.
  • You can't refer to external CSS stylesheets, everything need to be on the CSS file


CSS:

  • In the CSS file, all general classes should have a start with a sheet- prefix for Roll20 to read them.
  • Media queries can't currently be utilized
  • Do not use .sheet-new-window as a CSS class name, as Roll20 already uses it and will block you from trying to override it. Forum thread
  • Roll20 have some predefined CSS classes for it's custom row/column system and other default, so very generic class names like: .sheet-row, .sheet-col, 3colrow, 2colrow and .sheet-character is best to be avoided.
  • Repeating Sections Restrictions
  • Default Fonts: The following fonts can be accessed by default: Arial, Patrick Hand, Contrail One, Shadows Into Light and Candal
  • Google Fonts: can be used with the @import-function [Note: If you use @import with Google’s own generated URL, you may see the following error: Potential CSS security violation; character sheet template styling thrown out. To work around this issue, change css2?family to css?family in the URL (i.e., remove the “2”).]
  • You can't refer to external CSS stylesheets, everying need to be on the CSS file


JavaScript: (Main Article: Sheetworkers)

Many JavaScript functions or functionalities can't be used within Roll20, and everything and one should check existing sheet for user-cases, if you're attempting to do any slightly more advanced data-handling.

[edit] Only Use Classes, not IDs

You should not use IDs on your tags (for example, DO NOT do <input type='text' id='name' />). Since there are multiple copies of each sheet in the DOM at once, using an ID is incorrect since IDs should only be used on unique elements.

This does mean that you cannot utilize ID-linked <label> elements (eg, <label for="my_id">My Label Text</label>). You can place elements inside the label to link them together (eg, <label>Label Text <input ... /></label>), although that can come at the expense of some flexibility in your CSS.


[edit] Related Pages