Dotclear

source: admin/style/scss/partials/_forms.scss @ 3639:fe9f4d94f86b

Revision 3639:fe9f4d94f86b, 3.7 KB checked in by franck <carnet.franck.paul@…>, 8 years ago (diff)

Add required attribute for mandatory fields

Line 
1input[type=text],
2input[type=password],
3input[type=submit],
4input[type=button],
5input[type=reset],
6a.button,
7button,
8textarea,
9select,
10legend {
11     max-width: 100%;
12}
13
14input[type=text],
15input[type=password],
16input[type=submit],
17input[type=button],
18input[type=reset],
19a.button,
20button,
21textarea,
22legend {
23     border-radius: 3px;
24}
25
26form {
27     display: block;
28     margin: 0;
29     padding: 0;
30}
31
32fieldset {
33     display: block;
34     margin: 1em 0;
35     padding: 1em 0.5em;
36     border-width: 1px 0;
37     border-style: solid;
38     border-color: #ccc;
39     background: #f7f7f7;
40     &:focus-within {
41          background-color: #eee;
42     }
43}
44
45input[type=text],
46textarea {
47     font-family: $sans-serif-input;
48     font-size: 100%;
49}
50
51legend {
52     padding: 0.2em 0.6em;
53     border-width: 1px;
54     border-style: solid;
55     border-color: #676e78;
56     background: #fff;
57     margin-bottom: 0.5em;
58}
59
60label .maximal,
61textarea.maximal,
62input.maximal,
63select.maximal {
64     width: 99%;
65}
66
67input.invalid,
68textarea.invalid,
69select.invalid,
70input:not([type=file]):invalid:not(:focus) {
71     color: #900;
72     box-shadow: 0 0 0 3px rgba(218, 62, 90, 0.3);
73}
74input.invalid,
75textarea.invalid,
76input:not([type=file]):invalid:not(:focus) {
77     border: 1px solid red;
78     background: #FFBABA;
79}
80
81input[type=text],
82input[type=password],
83textarea,
84select,
85input:not([type=file]):invalid,
86input:not([type=file]):invalid:placeholder-shown {
87     color: #000;
88     box-shadow: 1px 1px 2px #f3f3f3 inset;
89     padding: 3px;
90     vertical-align: top;
91}
92input[type=text],
93input[type=password],
94textarea,
95input:not([type=file]):invalid,
96input:not([type=file]):invalid:placeholder-shown {
97     background: #fcfcfc;
98     border-width: 1px;
99     border-style: solid;
100     border-color: #dfdfdf;
101}
102
103input:focus,
104textarea:focus {
105     border-color: #9bca1c;
106}
107
108textarea {
109     padding: 2px 0;
110     &.maximal {
111          resize: vertical;
112     }
113     .area & {
114          display: block;
115          width: 100%;
116          resize: vertical;
117     }
118}
119
120select {
121     padding: 2px 0;
122     vertical-align: middle;
123}
124@media not all and (min-resolution:.001dpcm)
125{ @supports (-webkit-appearance:none) {
126     /* Safari 10.1+ only (https://browserstrangeness.bitbucket.io/css_hacks.html#webkit) */
127     select {
128          font-size: initial;
129    }
130}}
131
132select.l10n option {
133     padding-left: 16px;
134}
135
136option.avail10n {
137     background: transparent url(../images/check-on.png) no-repeat 0 50%;
138}
139
140input[type=text],
141input[type=password],
142textarea {
143     margin-right: .3em;
144}
145
146input[type=checkbox],
147input[type=radio],
148input[type=file] {
149     border: none;
150     margin: 0 .33em 0 0;
151     padding: 0;
152     background: transparent;
153}
154input + input[type=checkbox] {
155     // Used for js expand/hide (lists, options, ...)
156     margin-left: .33em;
157}
158a input {
159     // Used for js expand/hide (lists, options, ...)
160     margin-right: .33em;
161}
162
163input[type=file] {
164     margin-top: .3em;
165     margin-bottom: .3em;
166}
167
168optgroup {
169     font-weight: bold;
170     font-style: normal;
171}
172
173option {
174     font-weight: normal;
175}
176
177label,
178label span {
179     display: block;
180}
181
182label.ib,
183input.ib {
184     display: inline-block;
185}
186
187label.classic {
188     display: inline;
189}
190
191label.classic input,
192label span input,
193label.classic select,
194label span select {
195     display: inline;
196}
197
198label.required {
199     font-weight: bold;
200}
201
202label.required abbr {
203     color: #900;
204     font-size: 1.3em;
205}
206
207label.bold {
208     text-transform: uppercase;
209     font-weight: bold;
210     margin-top: 2em;
211}
212
213label.area,
214p.area {
215     width: inherit !important;
216}
217
218p.field {
219     position: relative;
220     label {
221          display: inline-block;
222          width: 14em;
223     }
224     &.wide label {
225          width: 21em;
226     }
227     input,
228     select {
229          display: inline-block;
230     }
231}
232
233.form-note, .form-stats {
234     font-style: italic;
235     font-weight: normal;
236     color: #676e78;
237}
238
239p.form-note, p.form-stats {
240     margin-top: -.7em;
241}
242
243span.form-note, span.form-stats {
244     text-transform: none;
245}
246
247// .more-info Additional information on fieldset, field, … (may be hide from user-prefs)
248.more-info {}
249
250.no-more-info {
251     display: none;
252}
Note: See TracBrowser for help on using the repository browser.

Sites map