Subversion Repositories wimsdev

Rev

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