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 .
×

Charactersheet --fond ??? impossible

Good morning all , here is my problem. I would like to change the background color of the blocks via my html file. Currently the color is declared in the css file. the idea when they make a choice in a list it will change the background color (ethics). Bonjour a tous , voici mon problème. jaimerais changer la couleur de fond des bloc via mon fichier html. Actuelllement la couleur est déclarée dans le fichié css. l'idée lorsque ils font un choix dans une liste cela changera la couleur du fond (éstéthique). Code actuel  CSS .charsheet   {      font-family : "Segoe UI" ,  Arial ;      min-width : 830px ; --fond: RGB(100,0,100)      padding-left : 20px   !important ;      padding-right : 20px   !important ; } Html liste < label >                      < span > Maison </ span >                         < select   name = "attr_Maison" >                          < option   value = "0"    selected ></ option   >                          < option   value = "1" > Gryffondor </ option >                          < option   value = "2" > Serpentard </ option >                          < option   value = "3" > Poufsouffle </ option >                          < option   value = "4" > Serdaigle </ option >                                               </ select > Javascript on(         "change:Maison sheet:opened"         , function()          {             getAttrs(["Maison"], function(value)             {                 const Maison = parseInt(value["Maison"], 10)||0;                                  if(Maison == 0)                 {                     ?                 }                                  if(Maison == 1)                 {                    ?                  }                                  if(Maison == 2)                 {                    ??                  }                                  if(Maison == 3)                 {                     ??                 }                 if(Maison == 4)                 {                     ??                 }             });         }); Merci d'avance pour vôtre aide                    
1618237305
Finderski
Pro
Sheet Author
Compendium Curator
You'll still need to manage the color via the CSS, because sheetworkers can't change the DOM.  So, what you'll need to do is put a hidden input with the name attr_Maison and class (perhaps "color") above the sections that need the new color and then do your CSS something like... input[value=0].sheet-color ~ .sheet-colorClass { background-color: black; } input[value=1].sheet-color ~ .sheet-colorClass { background-color: maroon; } Something like that
1618250084

Edited 1618250113
Thank you I try this tonight
1618262459
Richard T.
Pro
Marketplace Creator
Sheet Author
Compendium Curator
You are also missing a semi-colon after your variable.  .charsheet  {     font-family:"Segoe UI", Arial;     min-width:830px; --fond: RGB(100,0,100);     padding-left:20px !important;     padding-right:20px !important; }
1618280860
vÍnce
Pro
Sheet Author
cool idea.