Elgg  Version master
forms.css.php
Go to the documentation of this file.
1 <?php ?>
2 /* <style> /**/
7 /* ***************************************
8  Form Elements
9 *************************************** */
10 .elgg-form-body,
11 .elgg-form-body > div,
12 .elgg-form-body fieldset:not(.elgg-fieldset) > div,
13 .elgg-field {
14  &:not(:last-child) {
15  margin-bottom: 1rem;
16  }
17 }
18 
19 .elgg-form-alt > .elgg-form-footer {
20  border-top: 1px solid $(border-color-soft);
21  padding: 10px 0;
22 }
23 
24 label, .elgg-field-label {
25  font-weight: 600;
26  font-size: 0.9rem;
27  line-height: 1.8rem;
28 }
29 
30 .elgg-field-label {
31  display: block;
32 }
33 
34 .elgg-field-disabled {
35  .elgg-field-label {
36  opacity: 0.6;
37  }
38 }
39 
40 .elgg-required-indicator {
41  font-size: 110%;
42  font-weight: bold;
43  color: $(state-danger-font-color);
44  display: inline;
45  padding: 0 5px;
46 }
47 
48 input, textarea {
49  border: 1px solid $(border-color-mild);
50  color: $(text-color-strong);
51  font-size: 1rem;
52  padding: 0.25rem 0.5rem;
53  line-height: normal;
54  width: 100%;
55  border-radius: 3px;
56 }
57 
58 input:disabled,
59 textarea:disabled,
60 select:disabled,
61 option:disabled {
62  cursor: not-allowed;
63 }
64 
65 textarea {
66  padding: 0.5rem;
67 }
68 
69 input[type=email],
70 input[type=password],
71 input[type=text],
72 input[type=number],
73 input[type=url],
74 input[type=color],
75 input[type=datetime-local],
76 input[type=month],
77 input[type=search],
78 input[type=tel],
79 input[type=week], {
80  height: 2.5rem;
81 }
82 
83 input[type=email]:focus,
84 input[type=password]:focus,
85 input[type=text]:focus,
86 input[type=number]:focus,
87 input[type=url]:focus,
88 input[type=color]:focus,
89 input[type=datetime-local]:focus,
90 input[type=month]:focus,
91 input[type=search]:focus,
92 input[type=tel]:focus,
93 input[type=week]:focus,
94 textarea:focus {
95  border: solid 1px $(border-color-strong);
96  background-color: $(background-color-soft);
97  /* We remove outlines from specific input types so we can leave the browser
98  defaults (like glows) for everything else */
99  outline: 0 none;
100 }
101 
102 input[type="checkbox"],
103 input[type="radio"] {
104  margin: 0 0.25rem 0 0;
105  padding: 0;
106  border: none;
107  width: auto;
108  vertical-align: middle;
109 }
110 
111 input[type="number"] {
112  -moz-appearance: textfield;
113 }
114 
115 .elgg-input-checkbox + label,
116 .elgg-input-checkbox + .elgg-field-label {
117  display: inline-block;
118 }
119 
120 .elgg-input-checkboxes.elgg-horizontal li,
121 .elgg-input-radios.elgg-horizontal li {
122  display: inline-block;
123  padding-right: 1rem;
124 }
125 
126 .elgg-color-box {
127  width: 1.0rem;
128  height: 1.0rem;
129  display: inline-block;
130  background-color: #ccc;
131  left: 5px;
132  top: 5px;
133  border: 1px solid #000;
134  border-radius: 3px;
135 }
136 
137 .elgg-input-color {
138  width: 4.5rem;
139 }
140 
141 <?php
142 echo elgg_view('elements/misc/checkbox_switch.css');
143 ?>
144 
145 select {
146  max-width: 100%;
147  border: 1px solid $(border-color-mild);
148  color: $(text-color-strong);
149  padding: 0.25rem 0.5rem;
150  line-height: 1.75rem;
151  vertical-align: middle;
152  border-radius: 3px;
153 }
154 
155 select:not([multiple]) {
156  height: 2.5rem;
157 }
158 
159 .elgg-form-account {
160  margin-bottom: 1rem;
161 }
162 
163 .elgg-input-radios label {
164  font-weight: normal;
165  font-size: 100%;
166 }
167 
168 .elgg-input-checkboxes {
169  label {
170  font-weight: normal;
171  font-size: 100%;
172  line-height: inherit;
173  }
174 
175  &.elgg-horizontal label > .elgg-input-checkbox {
176  vertical-align: baseline;
177  }
178 }
179 
180 .elgg-form-login, .elgg-form-account {
181  max-width: 40rem;
182  margin: 0 auto;
183 }
184 
185 .elgg-fieldset {
186  display: flex;
187  flex-direction: column;
188  gap: 1rem;
189 
190  &.elgg-fieldset-has-legend {
191  border: 1px solid $(border-color-soft);
192  padding: 1rem;
193  margin-bottom: 1rem;
194  }
195 
196  > .elgg-field {
197  margin: 0;
198  }
199 }
200 
201 @media $(media-phone-up) {
202  .elgg-fieldset-horizontal {
203  flex-direction: row;
204 
205  > .elgg-field {
206  vertical-align: top;
207 
208  display: flex;
209  flex-direction: column;
210 
211  &.elgg-field-stretch {
212  flex-basis: 1%;
213  flex-grow: 1;
214 
215  > .elgg-field-input {
216  width: 100%;
217  }
218  }
219 
220  &.elgg-field-horizontal {
221  flex-direction: row;
222  align-items: baseline;
223 
224  > *:not(:first-child) {
225  padding-left: 1rem;
226  }
227  }
228 
229  > .elgg-field-label {
230  align-items: center;
231  display: flex;
232  flex-shrink: 0;
233  }
234  }
235 
236  &.elgg-fieldset-wrap {
237  flex-wrap: wrap;
238  }
239 
240  &.elgg-justify-right {
241  justify-content: flex-end;
242  }
243 
244  &.elgg-justify-center {
245  justify-content: center;
246  }
247  }
248 }
249 
250 <?php
251 echo elgg_view('elements/components/autocomplete.css', $vars);
252 echo elgg_view('elements/components/datepicker.css', $vars);
253 echo elgg_view('input/entitypicker.css', $vars);
254 echo elgg_view('input/tags.css', $vars);
elgg
Definition: install.js:27
elgg_view(string $view, array $vars=[], string $viewtype= '')
Return a parsed view.
Definition: views.php:156
$site email
Definition: settings.php:16
$vars
Definition: theme.php:5
$data label
Definition: default.php:22