Subversion Repositories wimsdev

Rev

Rev 13991 | Rev 16837 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

  1. /** themes/_css - forms.css */
  2. /**  Somes styles designed to display fields in forms, tableless **/
  3. /* Currently used in exam and documents properties **/
  4.  
  5. /*form{
  6.     line-height: 2em;
  7. }*/
  8.  
  9. /* corrects attributes color:inherit from normalize.css */
  10. input, textarea {
  11.   color:black;
  12. }
  13. input[disabled], textarea[disabled] {
  14.   color:#444;
  15.   background-color:#DFDFDF;
  16. }
  17.  
  18. sup input:not([type="color"]), .wims_mathml .msup textarea, .wims_mathml msup textarea,
  19. sub input:not([type="color"]), .wims_mathml .msub textarea, .wims_mathml msub textarea{
  20.   padding:2px;
  21. }
  22.  
  23.  
  24. /***** Foundation 6 input styles *****/
  25.  
  26. input:not([type]), [type="text"], [type="password"], [type="date"], [type="datetime"],
  27.  [type="datetime-local"], [type="month"], [type="week"], [type="email"], [type="number"],
  28.  [type="search"], [type="tel"], [type="time"], [type="color"], [type="url"], textarea {
  29.   border: 1px solid #cacaca;
  30.   box-sizing: border-box;
  31. }
  32.  
  33. /* everything but color */
  34. input:not([type]), [type="text"], [type="password"], [type="date"], [type="datetime"],
  35.  [type="datetime-local"], [type="month"], [type="week"], [type="email"], [type="number"],
  36.  [type="search"], [type="tel"], [type="time"], [type="url"], textarea {
  37.   padding: .5rem;
  38. }
  39.  
  40. input:not([type]):focus, [type='text']:focus, [type='password']:focus,
  41.  [type='date']:focus, [type='datetime']:focus, [type='datetime-local']:focus,
  42.  [type='month']:focus, [type='week']:focus, [type='email']:focus, [type='number']:focus,
  43.  [type='search']:focus, [type='tel']:focus, [type='time']:focus, [type='url']:focus,
  44.  [type='color']:focus, textarea:focus {
  45.   outline: none;
  46.   border: 1px solid #8a8a8a;
  47.   background-color: #fefefe;
  48.   box-shadow: 0 0 5px #cacaca;
  49.   transition: box-shadow .5s, border-color .25s ease-in-out;
  50. }
  51.  
  52.  
  53.  
  54. /* don't glue labels to their associated input */
  55. input[type="radio"]+label, input[type="checkbox"]+label{
  56.   padding-left: .3em;
  57. }
  58.  
  59. fieldset>ul{
  60.   margin: 0;
  61.   padding-left: 1.5em;
  62. }
  63. /* this is generaly a fieldset class */
  64. .property_fields{
  65.   /* Sadly, Safari don't handle flex on fieldsets yet (you have to add a div inside)...*/
  66.   display:flex;
  67.   flex-flow: row wrap;
  68.   position: relative;
  69.   margin-top:1em;
  70.   margin-bottom:1em;
  71.   max-width:900px;
  72.   padding:.5em 3px;
  73.   /*Background-image is here to lighten background color */
  74.   background-image: linear-gradient(to bottom,  rgba(255,255,255,0.7) 0%,rgba(255, 255, 255, 0.9) 48%,rgba(255,255,255,0.4) 100%); /* W3C */
  75. }
  76. /* If property_fields is flex, wimscenter must take the full width*/
  77. .property_fields .wimscenter{
  78.   width:100%;
  79. }
  80.  
  81. /*.property_fields .field {
  82.         margin: auto;
  83. }*/
  84.  
  85. .property_fields .actions,
  86. .property_fields .wimsform{
  87.   padding:.5em;
  88.   margin-top:.5em;
  89. }
  90. .property_fields>fieldset{
  91.   margin-bottom:.5em;
  92. }
  93.  
  94. .field.box{
  95.   padding: .4em .4em .8em .4em; /*.4em seems max for Chrome 2-columns layout */
  96.   border:1px solid #CFCFCF;
  97.   /*margin-bottom:1px;*/
  98.   line-height:1.2em;
  99.   /* min height lets having an help button right float*/
  100.   min-height:2em;
  101.   flex-grow: 1;
  102. }
  103.  
  104. .box_title{
  105.   margin-top:0;
  106.   margin-bottom: .5em;
  107.   background-color: var(--wims_bgcolor);
  108.   padding: 2px;
  109. }
  110.  
  111. .property_fields p{
  112.   padding:0 1em;
  113. }
  114.  
  115. /*.box>div, .box>input, .box>textarea, .box>select{
  116.   margin-left:.3em;
  117. }*/
  118.  
  119. .property_fields .halfwidth{
  120.   /*display: inline-block;
  121.   vertical-align: middle;*/
  122.   float:left;
  123.   /*min-width: 380px;*/
  124.   /*min-height could be suppressed when all browsers will render well "flexbox"*/
  125.   min-height:4em;
  126. }
  127.  
  128. .property_fields .field:nth-child(even){
  129.   background-color: #DFDFDF;
  130.   background-color: rgba(230,230,230,.4);
  131. }
  132.  
  133. .property_fields .field:nth-child(odd){
  134.   background-color: #EFEFEF;
  135.   background-color: rgba(255,255,255,.8);
  136. }
  137.  
  138. .formHelp{
  139.   font-size: 9pt;
  140.   color:#666;
  141. }
  142.  
  143. .property_fields legend{
  144.   font-size: 1.2em;
  145.   font-weight: bold;
  146.   padding: 0 .5em;
  147.   margin-left:1em;
  148.   border:1px solid #BBB;
  149.   border-radius:5px;
  150. }
  151.  
  152. .field>label{
  153.   font-weight:bold;
  154.   font-size: .875rem;
  155.   line-height: 1.8;
  156.   display:inline-block;
  157.   vertical-align: middle;
  158. }
  159.  
  160. /*.property_fields .field>label{
  161.   min-width:10em;
  162. }*/
  163.  
  164. .property_fields select,.property_fields textarea{
  165.   vertical-align: middle;
  166. }
  167.  
  168. .field input[type="text"]:not(.inline),
  169. .field input[type="password"]:not(.inline),
  170. .field input[type="email"]:not(.inline),
  171. .field input[type="number"]:not(.inline),
  172. .field input[type="url"]:not(.inline),
  173. /*.field select,*/
  174. .field textarea{
  175.   width:100%;
  176. }
  177.  
  178.  
  179. .field input.small_input{
  180.   width:6em;
  181.   min-width:6em;
  182. }
  183.  
  184. input[type="color"]{
  185.   vertical-align: middle;
  186.   /* min size prevents Safari displaying a very small button */
  187.   min-width: 44px;
  188.   min-height: 23px;
  189. }
  190.  
  191. li.wims_formradio{
  192.   display: block;
  193. }
  194. .wims_formradio label {
  195.   min-width:0;
  196.   font-weight:normal;
  197. }
  198.  
  199. /** Styles for HTML 5 inputs (required or typed, like type="number")*/
  200. input:not([type="submit"]):not([type="button"]), textarea{
  201.   background-repeat: no-repeat;
  202.   /* 92% lets some browsers display control buttons like for the type="number" input */
  203.   background-position-x: 92%;
  204.   background-position-y: 3px;
  205. }
  206. input:required:not(.noicon), textarea:required:not(.noicon){
  207.   /* The padding is more precise than the 92%, but we apply it only for required inputs */
  208.   padding-right: 1em;
  209.   background-position-x: right;
  210. }
  211. /* invalid required inputs */
  212. input:invalid, textarea:invalid, .required_invalid_legend {
  213.   background-image: url("../../../gifs/svg/exclamation_mark_red.svg");
  214.   background-size: 1em;
  215.   box-shadow: 0 0 1px rgba(200, 0, 0, .85);
  216. }
  217. /* invalid inputs, with focus  */
  218. input:focus:invalid, textarea:focus:invalid, .required_invalid_focus_legend {
  219.   background-image: url("../../../gifs/svg/thumb_down_red.svg");
  220. }
  221. /* valid required inputs (dont show the green check on all valid, only required ones) */
  222. input:required:focus:valid, textarea:required:focus:valid, .required_valid_legend {
  223.   background-image: url("../../../gifs/svg/yes_check_green.svg");
  224.   background-size: .9em;
  225.   box-shadow: 0 0 1px rgba(0, 200, 0, .85);
  226. }
  227. /* noicon css class disable the required icon */
  228. input.noicon,
  229. input.noicon:required,
  230. input.noicon:required:focus,
  231. textarea.noicon:required,
  232. textarea.noicon:required:focus{
  233.   background-image:none;
  234. }
  235.  
  236.  
  237. /* Small screens */
  238. @media only screen and (max-width: 40em) {
  239.   .property_fields .halfwidth, .halfwidth{
  240.     width:100%;
  241.     display:block;
  242.     min-width: 0;
  243.   }
  244.   /* prevent inputs from being larger than screen*/
  245.   /*.box input:not([type="button"]):not([type="color"]),.box select,.box textarea{
  246.     width:75%;
  247.   }*/
  248.   .property_fields pre{
  249.     max-width:33em;
  250.   }
  251. } /* max-width 640px, mobile-only styles, use when QAing mobile issues */
  252.  
  253. /* Medium screens */
  254. @media only screen and (min-width: 40.063em) and (max-width: 64em) {
  255.   .property_fields .halfwidth{
  256.     min-width: 310px;
  257.   }
  258.   .property_fields pre{
  259.     max-width:53em;
  260.   }
  261. } /* min-width 641px and max-width 1024px, use when QAing tablet-only issues */
  262.  
  263. /* Large screens */
  264. @media only screen and (min-width: 64.063em) {
  265.   .property_fields pre{
  266.     max-width:850px;
  267.   }
  268. } /* min-width 1025px, large screens */
  269.  
  270.