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