Subversion Repositories wimsdev

Rev

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