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 Media Queries

1578750614

Edited 1578750665
I was bit frustrated by the non-responsive nature of most sheets so I started looking into writing my own.  But my biggest issue may be due to an inherent limitation that I won't be able to solve easily. I can see that on the roll20 wiki that there's a comment about Media Query usage. CSS: Media queries  doesn't seem to be usable This seems like a strange statement, are they meant to work but don't and the devs are intending on fixing that? Or is it an inherent limitation of how the custom css is implemented? Although you can make somewhat responsive layouts without media queries using flex and grid, you can't reorganise the page like you can do with grid areas etc at different breakpoints. Any info appreciated, thanks.
1578751603

Edited 1578751741
Andreas J.
Forum Champion
Sheet Author
Translator
To my understanding, that CSS feature is excluded by the security filter, and that there isn't a clear statement whether it will be included in the future.(FYI I wrote the section about Roll20 limitations) During the 2020 January Community Roundtable, when a Roll20 developer was asked if this could be changed, in the general context of allowing media queries to be able to detect screen size if/when sheets becomes available on the upcoming Roll20 mobile app, the answer was considering but noncommittal. I haven't pushed further on this, nor have I created a Suggestion for this, as with my mediocre knowledge of CSS haven't even covered all other things I could do. I assume you know that you need access to a Pro subscription to be able to use custom character sheets or properly develop them. On a related note, Google Fonts will be implemented at some point this year, this was mentioned in that same round-table.
1578752825

Edited 1578752876
Thanks a lot for the info! Me and a friend are currently fixing some bits on for a Warhammer 4e sheet which should have a ton of fixes in this weekend for Mondays review.  The sheet was created by someone else though so the styling and everything is more difficult to work with but it should at least be useable for everyone. Whilst playing with sheet worker scripts etc the only thing thats really annoying is that I can't call the roll command from them, so I can't make rolls affect attributes on the page.  I think you could do almost anything if they would allow this, allowing you to track extended tests etc. I tried a few things with the javascript but pretty much all of them were blocked (not trying to do anything dodgy!). Ahh well. Regards, Pete
1578753625
Andreas J.
Forum Champion
Sheet Author
Translator
Pete L. said: Whilst playing with sheet worker scripts etc the only thing thats really annoying is that I can't call the roll command from them, so I can't make rolls affect attributes on the page. Yeah, roll button macros or macros in general can't changes attributes on the sheet, you need to use API for that. CharSetAttr is the best candidate for doing this. Pete L. said: Me and a friend are currently fixing some bits on for a Warhammer 4e sheet which should have a ton of fixes in this weekend for Mondays review.  The sheet was created by someone else though so the styling and everything is more difficult to work with but it should at least be useable for everyone. If you talk about this Warhammer 4e sheet and intend to submit your changes to the public sheet,  I suggest you speak up in the thread about this, so you don't catch any active sheet authors off guard.
1578754463

Edited 1578754682
I'll check out the API, maybe I can do it all with that.  Don't want to spend a ton of time on this as it's a side-side-side-project and I should probably be working on something else :) If you talk about this  Warhammer 4e sheet  and intend to submit your changes to the public sheet,  I suggest you speak up in the thread about this, so you don't catch any active sheet authors off guard. Hmm this may be the same project, although hes changed it up a lot. Although my friend got this added to github last week so i'll need to double check.  Thanks again.
1578755445
GiGs
Pro
Sheet Author
API Scripter
Many of the pages on the wiki were made my the community, not the devs, so a comment like "doesn't appear to be usable" comes about because users have tried to make them work and havent succeeded. It doesnt imply that staff have any intention of changing a function in the future, it's just an observation by users to other users. As you've found, most uses of javascript are blocked - we can manipulate attributes, and thats basically it. Through that we have some ability to influence CSS, because they can read hidden input values.  Pete L. said: Whilst playing with sheet worker scripts etc the only thing thats really annoying is that I can't call the roll command from them, so I can't make rolls affect attributes on the page.  I think you could do almost anything if they would allow this, allowing you to track extended tests etc. Depending on what exactly you need, you might be able to do something. Action buttons let you trigger sheet workers, so you can simulate rolls with Math.random, but you can't print out the roll to the chat. You can track consumables, etc. If you trust your players, you could have an action button simulate a roll a(and update any needed attributes), and save the roll output to an attribute. Then use a roll button that prints that attribute to chat - so you get the simulation of a roll.  It would be two buttons to click, and you'd have to trust the player not to keep rerolling the first one till they get what they want (though there are ways to check that). It's not ideal, it is a bit clunky for general use. If you have access to Custom Sheets, you have access to API scripts and they provide a better solution to this kind of thing.
1578765814

Edited 1578765859
Hi GiGs,  I tried something similar with action buttons to what you suggested, but I don't think our GM would ever go with "Hidden" rolls (not sure I could trust myself either). It's not too much effort to manually track the complex stuff and we've modified the sheet so that all of the simpler stuff now matches the rules. I know it must be difficult providing a secure extensible playground for people to create their own sheets without wreaking havoc so i'm not going to complain too much. I'm not sure of any potential issues with including media queries though and it could a long way to creating some great sheets using the existing stuff. Pete