#a11y-css-tweaks

1 messages ยท Page 1 of 1 (latest)

wicked sierra
#

Cool lets do a quick bootcamp.

#

@granite laurel

granite laurel
#

Ok

wicked sierra
#

So to summarize; you have a player who needs some assistance by providing increased font size in particular places of the UI; correct?

granite laurel
#

I am a player who needs to increase the size of font in all the places in the UI

wicked sierra
#

If your GM isn't available to do so currently, that's fine, i can demo this on my own server and provide you a list of rules to implement once the GM does have it installed

#

For some background, Foundry VTT's entire UI is composed of HTML and CSS; with CSS providing the appearance.

granite laurel
#

OK Fin Might still be around

wicked sierra
#

The benefit of this is that on the client side GMs and Players can customize how the UI looks for them if they want to take a little time.

We're working toward better UI customization options in a user friendly way as we progress with development but we're not exactly "there yet" with a11y support.

granite laurel
#

Yeah the sand on sand submission box was a bear to try to send a note in, I tried to edit out the pissed off

wicked sierra
#

I'll take a moment and throw the custom css module on my own server and drop you a link.

granite laurel
#

ok

wicked sierra
#

Since I was gonna do something like this for someone else, I'll take a moment and invite @humble tiger to watch and review the tutorial of how to use the devtools to define CSS in realtime and see how it will look for you.

granite laurel
#

Yeah absolutely

#

I have my magnifier lens on to make this easier

#

I asked my GM if he was still on but hes off probably to work

wicked sierra
#

It's cool, what i show you here should be easy to bring over to the GM's game later.

granite laurel
#

That works

wicked sierra
#

Gonna grab a beverage while you get logged in.

granite laurel
#

ok still need a link

#

didnt see the pm was focused on the wrong corner of the screen

wicked sierra
#

No worries ๐Ÿ™‚

#

Right, so before we get into our options for scaling things up i'm gonna take a minute and teach you some tricks for using the dev-tools that elude some users. Do you use Chrome or Firefox?

granite laurel
#

Chrome It works better with my eyes

wicked sierra
#

Excellent, FVTT looks best in chrome as it's developed with chrome in mind

#

Windows, Mac, or Linux?

granite laurel
#

Windows 11

wicked sierra
#

Cool. In the FVTT window press f12 and you'll see the devtools appear. The font in this window may be very small depending on whether or not your operating system settings scale it up for you.

granite laurel
#

its small but I have the windows lens up

wicked sierra
#

Cool, i'm gonna post a screenshot here that i'll use to explain what you're looking at, wait one

granite laurel
#

ok

wicked sierra
#

area 1 shows the HTML elements you can edit.
Area 2 is where we will be making changes to the CSS rules to change appearance
The button marked by the arrow and number 3 is the "Selector" which we'll be using to pick which elements we're changing the style of. By clicking on it, and then clicking anything in the FVTT window, you can see what CSS rules affect that element and make temporary changes to it.

#

At any point if you make a rules change that doesn't work out, you can either remove/toggle/disable it in area 2, or you can press f5 and it will wipe out all changes you've made and return FVTT to its default state.

granite laurel
#

Ok

wicked sierra
#

Now, there's a few ways we can handle issues of screen scale.

One is to apply a "zoom" to the overall program, which can work, but isn't ideal because it affects literally everything and isn't much different from Windows display scaling.

#

To see what i mean, click the Selector (at point 3) and click anywhere on the canvas- where tokens normally move

#

You'll see a section in area 2 that says body { -- it will be the 4th or 5th item down the list and contain a bunch of greyed out rules.

#

Clicking inside that box (but not on a particular rule) will give you a cursor and allow you to type.

So lets type zoom: and you'll see it will enter the zoom rule and leave you with a cursor for setting what zoom amount.

#

let's do 1.5;

#

You'll see everything becomes huge and a lot of the UI will be pushed off-screen

granite laurel
#

yep breaks things and my scroll bars got pushed off too

wicked sierra
#

So obviously zooming everything isn't the way we want to go; this was just a handy example of how to use CSS to change things.

Go ahead and click the checkmark next to the zoom: rule you set to uncheck it- this will disable that rule

granite laurel
#

I have

wicked sierra
#

Now let's take a moment and figure out what changes you actually want to achieve.

Are the sizes of UI elements that aren't text---such as the buttons on the left, the macro buttons at the bottom, the size of the sidebar---are those fine?

granite laurel
#

sidebar is ok macro buttons work, the buttons need to be bigger

wicked sierra
#

Okay, so let's make a rule for scaling the buttons on the left up.

#

Click your selector and click on a button; --- Now here's a tricky piece.

#

We don't just want to change one button- we want to change them all.

#

So if you take a look at area 1 in the screenshot - where all the individual HTML elements are, you'll likely see that you're currently highlighted on something like this:

granite laurel
#

I'm with you

wicked sierra
#

now we don't want to just pick that one list item (<li>)---we want the section of the UI that manages it.The "nav"

granite laurel
#

ok

wicked sierra
#

so in the HTML list click the nav with the id "controls"

#

and let's apply a zoom level to just that; so just as we did before, we'll create a new css rule: zoom: 1.25

#

which will probably get it to a pretty comfortable size for you---but you can tweak the number as much as you want. When you've settled on what that number is, share it here

#

if you get into trouble or feel a bit lost don't hesitate to ask questions; i'm catering this to 'entry level' because i don't know what level of familiarity with this stuff you have. ๐Ÿ™‚

granite laurel
#

1.5 will work let me push it up to two

#

2 is better

wicked sierra
#

Cool; so now what i'd suggest is to keep track of your changes, open up a windows notepad

granite laurel
#

I am taking notes!

#

I pulled my tablet out to do so

wicked sierra
#

The reason i suggest windows notepad is because it will let us log the rules we're going to save as changes on your end, so you can copy-paste them into the custom CSS module later. ๐Ÿ™‚

in the windows notepad, we'll add our first rule:

nav#controls {
zoom: 2;
}

The nav tells css what kind of HTML element it's looking for. # says to look by the id of the element, and the controls is the specific ID to look for. This means that your rule will ONLY apply to the lefthand control buttons.

#

The semicolon after the line is important

granite laurel
#

I have also been making screen shots to show me what the changes should look like

wicked sierra
#

One suggestion i'll make is that the token-hud will probably have a similar problem, and that one's a little more tricky to target, so i'll take a moment to give you a couple rules to add to your list

granite laurel
#

Yes that would help

wicked sierra
#
#token-hud .col.left {
zoom: 2;
}
#token-hud .col.right {
zoom: 2;
}
#token-hud .attribute.bar1 input  {
zoom: 2;
}
#token-hud .attribute.bar2 input  {
zoom: 2;
}
#

That should handle stuff for your token when you right click it to change things.

granite laurel
#

ok

wicked sierra
#

Now; for the stuff in the sidebar, presumably you want to scale your overall font size- are other things sized fine in the sidebar? The sidebar tabs at the top; the text in the 'roll mode' box?

granite laurel
#

Sidebar tabs need boosted too I can work with them but they are small and its basically position recognition with them

wicked sierra
#

Okay, unfortunately we can't really scale up the sidebar tabs without scaling up the whole sidebar- unless we want the available tab buttons to be cut off; so let's see how that goes.

using your selector, click on the sidebar; and ensure you're choosing the top level element in HTML (<div id="sidebar")

#

And then set your zoomlevel at the sidebar. I'd try 1.25--- 2 is definitely gonna push a lot of the sidebar off screen.

granite laurel
#

ok

wicked sierra
#

an alternative to using zoom here is to change the sidebar width

#

which we can do by setting width specifically (width: 500px)

#

That will give us some breathing room to resize individual elements inside the sidebar

granite laurel
#

Yeah we thought the same number

wicked sierra
#

If you choose to go with width; you would then modify the individual elements you want to have bigger; in this case, by choosing your selector and targeting the element <nav id="sidebar-tabs"

#

a zoom of about 1.5 will probably get those into your comfort zone if the sidebar width is 500px

#

above 1.5 you'll run into issues with it cutting off--but you could raise your sidebar width further if necessary.

granite laurel
#

1.75 works in the space from 500px and is easier then 1.5

wicked sierra
granite laurel
#

Im learning thanks

wicked sierra
#

So to check that you're picking up the CSS rules formatting; what would the CSS rule be for these two changes that you'd add to your notepad?

granite laurel
#

div#sidebar {
--sidebar-width: 500px;
}
nav#sidebar-tabs {
zoom: 1.75;
}

#

I copied a little too high

wicked sierra
granite laurel
#

ok

wicked sierra
#

Now, i think you've got most of the tricks neeeded to raise the font size; We can do so globally (using * {) or we can choose specific elements and their parents.

#

I would suggest that using a global can be as undesirable here as a global zoom; as it will squish other elements out if you increase the font size on everything

granite laurel
#

Globally should be the simplist right?

wicked sierra
#

and some elements with more specific rules will not be affected by a global change

#

chat messages, for example

granite laurel
#

Like how the Pathfinder 1 stuff wasnt effected by the text slider thats already there

wicked sierra
#

Exactly.

granite laurel
#

X(

wicked sierra
#

The chat cards will be the most annoying to change- because they often have font sizes set by subsection of the chat card

granite laurel
#

ok

wicked sierra
#

IE, the header has a specific font size, the body of the message another specific font size

#

but we may be able to cheat it a little using zoom

granite laurel
#

and the text slider doesnt really go far enough either so that will have to be changed as well

wicked sierra
#

So since you already have the sidebar width set bigger

granite laurel
#

The frustrating part is this is only going to get worse as cataracts suck at least until I can get the surgery

wicked sierra
#

I'll take a moment to take my dog outside and leave you with this challenge:

Using your selector, find which element you should target to give a "zoom: 2" to increase the size of individual chat messages without increasing the size of the entire chatlog.

#

once you figure it out, drop the rule in here and i'll share the one i found

#

Back from dog tending.

granite laurel
#

I found something but I dont think it was what I was trying to find, it did make something else more useable though

wicked sierra
#

Cool, share! ๐Ÿ˜„

#

For the record the one i'd use for chat messages is:

li.chat-message {
zoom: 2
}

This wasn't one i gave you an explainer for so don't feel bad for not finding it.

li - the html list element
. - indicates to select css by 'class'
chat-message - the chat-message css class.

This matches with the html: <li class="chat-message"

granite laurel
#

Ok under the
theres a section that says font size

#

you can see I boosted that font size and it changed the players and map tab

wicked sierra
#

Indeed! it would.

What you're doing when changing that is changing the global font size for the entire program (the equivalent of using the slider for font size in the settings menu)

#

"body" refers to the 'top level'

#

though i will note that i don't think it will affect chat messages specifically (because they're handled by more specific CSS rules)

granite laurel
#

it does not

#

which is annoying

wicked sierra
#

Fortunately my zoom trick on chat messages will probably take care of that for you

#

If you want to keep your change to the font-size rule in body; all you have to do is set a rule in your css file for

body {
font-size: <yourfontsizehere>;
}
granite laurel
#

Your li.chat message didnt change the system stuff so it looks like that will have to be changed manually

wicked sierra
#

hm. Which system stuff? (this is currently dnd5e)

#

can you give me an example element?

granite laurel
wicked sierra
#

Hmm. Odd. wait one.

#

Definitely working on more than one- i suspect you may have targeted that specific chat message and used the element.style section instead of .chat-message

#

Now let's carry through the next step; let's apply these rules persistently using the Custom CSS Rules module

#

On the settings sidebar tab (sidebarsettings ) go to 'configure settings'

#

Then go to 'module settings' and go to the 'custom css;'section, choose 'custom css rules'

#

and then just paste from your notepad straight into the "Custom CSS Rules" window and hit save.

granite laurel
#

Alright I am going to have to open up a table of my own because I cant see that in yours

wicked sierra
#

Hmmmm...you should be able to.

#

Time to create a player account for myself and be sure

#

Hm. You're right, doesn't seem to be showing. might be a permission thing. one moment

granite laurel
#

could be

wicked sierra
#

Okay, you may need to reload (f5) but you should have access now; your GM will need to set the permission "modify configuration settings" for you in the user permissions

granite laurel
#

that li.chat message zoom is functional but I think I need to learn how to globally set the font size because some things went too big and others didnt size up enough

wicked sierra
#

Fair enough. While you ponder that, i'll take a moment because i've just been informed that the reason this permission is gated behind GM is because, apparently, these changes impact all users; so i need to take a moment and investigate if there's a quick way to make this apply to just one user.

granite laurel
#

but this works and I can mess around with my own table until I get something that works the way I want it too

#

I am not the only VI user at our table so thats not a bad thing

#

our table has 50% vi player to some level

wicked sierra
#

can i get you to type

```css
<paste your notepad css rules here>
```

granite laurel
#
zoom: 2;
}
#token-hud .col.left {
zoom: 2;
}
#token-hud .col.right {
zoom: 2;
}
#token-hud .attribute.bar1 input  {
zoom: 2;
}
#token-hud .attribute.bar2 input  {
zoom: 2;
}
div#sidebar {
width: 500px;
}
nav#sidebar-tabs {
zoom: 1.75;
}
li.chat-message {
zoom: 2
}
body {
font-size: <yourfontsizehere>;
}
li.chat-message {
zoom: 2
}
wicked sierra
#

Cheers

i'll see about getting you a macro you can distribute to make this occur on only the client-side rather than 'for everybody.'

I suspect unless your GM has visual impairments they may find the larger UI a bit daunting.

granite laurel
#

They might but I know that they will work with it because they really dont want ot go back to roll20

#

and meeting in person requires far more money then is possible for a weekly session flights are expensive and there are 3 countries involved

wicked sierra
#

XD

granite laurel
#

Thanks for the help I appreciate it I really do like a lot of the features in foundry

wicked sierra
#
let style =`<style>
//Your Style Rules Below This Line
nav#controls {
zoom: 2;
}
#token-hud .col.left {
zoom: 2;
}
#token-hud .col.right {
zoom: 2;
}
#token-hud .attribute.bar1 input  {
zoom: 2;
}
#token-hud .attribute.bar2 input  {
zoom: 2;
}
div#sidebar {
width: 500px;
}
nav#sidebar-tabs {
zoom: 1.75;
}
li.chat-message {
zoom: 2;
}
body {
font-size: <yourfontsizehere>;
}
li.chat-message {
zoom: 2;
}
//Your Style Rules Above This Line
</style>`  

    document.head.insertAdjacentHTML("beforeend", style);

This is an ugly solution, but will work. Paste this into a script macro and it will only make changes for the users that execute that macro.

#

This also will work without you needing the Custom CSS module

granite laurel
#

OK makes sense, not all gms are going to want to make so many changes

wicked sierra
#

indeed; and as you refine your list of rules it can grow in there and individual users can tweak their own values as they please ๐Ÿ™‚

granite laurel
#

True

granite laurel
#

why doesnt this

body {
font-size: <--font-size-28>;
}

work?
and is there a way to make all of the table and character and compendium elements automatically inherit the body formatting because I cant figure out a command to make them change at all except for manually changing each one and that is a pain in the head to do as you might imagine (I wouldnt even mind a serries of commands if I could get it to work)

wicked sierra
granite laurel
#

That is the highest listed font size, 24 doesnt work either actually

wicked sierra
#

Odd. If you set it specifically to 1.75rem does it work?

gentle pebble
#

It does not work because <--font-size-28> is not a valid font size.

wicked sierra
#

Oh. Yeah. You'd use var(--font-size-28)

gentle pebble
#

You need to use var(--font-size-28) if you want to pull a variable. off the top of my head.

granite laurel
#

Oh well I can fix that easily enough

#

much better thanks!

wicked sierra
# granite laurel much better thanks!

and is there a way to make all of the table and character and compendium elements automatically inherit the body formatting because I cant figure out a command to make them change at all except for manually changing each one and that is a pain in the head to do as you might imagine (I wouldnt even mind a serries of commands if I could get it to work)
I'm occupied at the moment but i'll take a look at this for you. I assume you mean stuff inside character sheets and rollable tables?

granite laurel
#

Yep and the compendium I know I can manually change it to inherit I just want a command so I dont have to go in and edit before every game

granite laurel
#

Ok I found something that gets me closer

*{
font-size: var(--font-size-20);
}

but it leaves me with this, so I am halfway there roughly

wicked sierra
#

I've unfortunately got a large amount of work ahead of me for the day so i don't know for sure when i'll be able to get back to you on this----the game system here is pf1e?

granite laurel
#

Yep, I know you dont know when you can get back to me, but I figured I would keep you up to date on what I work out I can stop if thats easier on you

wicked sierra
granite laurel
#

Ok

wicked sierra
granite laurel
#

The first one does works, but means I have to take out

*{
font-size: var(--font-size-20);
}

which means manual fixes everywhere else

granite laurel
#

Ok with these 3 commands its down to just manually changing the compendium which is doable

nav#sidebar-tabs {
zoom: 1.75;
}
body {
font-size: var(--font-size-20);
}
li.chat-message {
font-size: var(--font-size-24);
}

lavish elm
#

@astral tinsel this might help