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