Subversion Repositories wimsdev

Rev

Rev 13330 | Rev 13695 | 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. /* don't glue labels to their associated input */
  19. input[type="radio"]+label, input[type="checkbox"]+label{
  20.   padding-left: .3em;
  21. }
  22.  
  23. fieldset>ul{
  24.   margin: 0;
  25.   padding-left: 1.5em;
  26. }
  27. /* this is generaly a fieldset class */
  28. .property_fields{
  29.   /* Sadly, Safari don't handle flex on fieldsets yet (you have to add a div inside)...
  30.   display:flex;
  31.   flex-flow: row wrap;*/
  32.   position: relative;
  33.   margin-top:1em;
  34.   margin-bottom:1em;
  35.   max-width:900px;
  36.   padding:.5em 3px;
  37.   /*Background-image is here to lighten background color */
  38.   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 */
  39. }
  40. /* If property_fields is flex, wimscenter must take the full width
  41. .property_fields .wimscenter{
  42.   width:100%;
  43. }*/
  44.  
  45. /*.property_fields .field {
  46.         margin: auto;
  47. }*/
  48.  
  49. .property_fields .actions,
  50. .property_fields .wimsform{
  51.   padding:.5em;
  52.   margin-top:.5em;
  53. }
  54. .property_fields>fieldset{
  55.   margin-bottom:.5em;
  56. }
  57.  
  58. .field.box{
  59.   padding: .4em; /*.4em seems max for Chrome 2-columns layout */
  60.   border:1px solid #CFCFCF;
  61.   /*margin-bottom:1px;*/
  62.   line-height:1.2em;
  63.   /* min height lets having an help button right float*/
  64.   min-height:2em;
  65. }
  66. .property_fields p{
  67.   padding:0 1em;
  68. }
  69.  
  70. .box>div, .box>input, .box>textarea, .box>select{
  71.   margin-left:.3em;
  72. }
  73.  
  74. .property_fields .halfwidth{
  75.   /*display: inline-block;
  76.   vertical-align: middle;*/
  77.   float:left;
  78.   /*min-width: 380px;*/
  79.   /*min-height could be suppressed when all browsers will render well "flexbox"*/
  80.   min-height:4em;
  81. }
  82.  
  83. .property_fields .field:nth-child(even){
  84.   background-color: #DFDFDF;
  85.   background-color: rgba(230,230,230,.4);
  86. }
  87.  
  88. .property_fields .field:nth-child(odd){
  89.   background-color: #EFEFEF;
  90.   background-color: rgba(255,255,255,.8);
  91. }
  92.  
  93. .formHelp{
  94.   font-size: 9pt;
  95.   color:#666;
  96. }
  97.  
  98. .property_fields legend{
  99.   font-size: 1.2em;
  100.   font-weight: bold;
  101.   padding: 0 .5em;
  102.   margin-left:1em;
  103.   border:1px solid #BBB;
  104.   border-radius:5px;
  105. }
  106.  
  107. .field>label{
  108.   font-weight:bold;
  109.   display:inline-block;
  110.   vertical-align: middle;
  111. }
  112. /*.property_fields .field>label{
  113.   min-width:10em;
  114. }*/
  115.  
  116. .property_fields select,.property_fields textarea{
  117.   vertical-align: middle;
  118. }
  119.  
  120. .halfwidth input[type="text"]{
  121.   min-width:50%;
  122. }
  123. .fullwidth input[type="text"]{
  124.   min-width:80%;
  125. }
  126. .field textarea{
  127.   min-width:70%;
  128. }
  129.  
  130. .fullwidth textarea{
  131.   width:96%;
  132. }
  133.  
  134. .field input.small_input{
  135.   width:6em;
  136.   min-width:6em;
  137. }
  138.  
  139. input[type="color"]{
  140.   vertical-align: middle;
  141.   /* min size prevents Safari displaying a very small button */
  142.   min-width: 44px;
  143.   min-height: 23px;
  144. }
  145.  
  146. li.wims_formradio{
  147.   display: block;
  148. }
  149. .wims_formradio label {
  150.   min-width:0;
  151.   font-weight:normal;
  152. }
  153.  
  154. /** Styles for HTML 5 inputs (required or typed, like type="number")*/
  155. input:not([type="submit"]):not([type="button"]), textarea{
  156.   background-repeat: no-repeat;
  157.   /* 92% lets some browsers display control buttons like for the type="number" input */
  158.   background-position-x: 92%;
  159.   background-position-y: 3px;
  160. }
  161. input:required:not(.noicon), textarea:required:not(.noicon){
  162.   /* The padding is more precise than the 92%, but we apply it only for required inputs */
  163.   padding-right: 1em;
  164.   background-position-x: right;
  165. }
  166. /* invalid required inputs */
  167. input:invalid, textarea:invalid, .required_invalid_legend {
  168.   background-image: url("../../../gifs/svg/exclamation_mark_red.svg");
  169.   background-size: 1em;
  170.   box-shadow: 0 0 1px rgba(200, 0, 0, .85);
  171. }
  172. /* invalid inputs, with focus  */
  173. input:focus:invalid, textarea:focus:invalid, .required_invalid_focus_legend {
  174.   background-image: url("../../../gifs/svg/thumb_down_red.svg");
  175. }
  176. /* valid required inputs (dont show the green check on all valid, only required ones) */
  177. input:required:focus:valid, textarea:required:focus:valid, .required_valid_legend {
  178.   background-image: url("../../../gifs/svg/yes_check_green.svg");
  179.   background-size: .9em;
  180.   box-shadow: 0 0 1px rgba(0, 200, 0, .85);
  181. }
  182. /* noicon css class disable the required icon */
  183. input.noicon,
  184. input.noicon:required,
  185. input.noicon:required:focus,
  186. textarea.noicon:required,
  187. textarea.noicon:required:focus{
  188.   background-image:none;
  189. }
  190.  
  191.  
  192. /* Small screens */
  193. @media only screen and (max-width: 40em) {
  194.   .property_fields .halfwidth, .halfwidth{
  195.     width:100%;
  196.     display:block;
  197.     min-width: 0;
  198.   }
  199.   /* prevent inputs from being larger than screen*/
  200.   .box input:not([type="button"]):not([type="color"]),.box select,.box textarea{
  201.     width:75%;
  202.   }
  203.   .property_fields pre{
  204.     max-width:33em;
  205.   }
  206. } /* max-width 640px, mobile-only styles, use when QAing mobile issues */
  207.  
  208. /* Medium screens */
  209. @media only screen and (min-width: 40.063em) and (max-width: 64em) {
  210.   .property_fields .halfwidth{
  211.     min-width: 310px;
  212.   }
  213.   .property_fields pre{
  214.     max-width:53em;
  215.   }
  216. } /* min-width 641px and max-width 1024px, use when QAing tablet-only issues */
  217.  
  218. /* Large screens */
  219. @media only screen and (min-width: 64.063em) {
  220.   .property_fields pre{
  221.     max-width:850px;
  222.   }
  223. } /* min-width 1025px, large screens */
  224.  
  225.