Elgg  Version 7.1
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 .elgg-input-checkbox + label,
121 .elgg-input-checkbox + .elgg-field-label {
122  display: inline-block;
123 }
124 
125 .elgg-input-checkboxes.elgg-horizontal li,
126 .elgg-input-radios.elgg-horizontal li {
127  display: inline-block;
128  padding-right: 1rem;
129 }
130 
131 .elgg-color-box {
132  width: 1.0rem;
133  height: 1.0rem;
134  display: inline-block;
135  background-color: #ccc;
136  left: 5px;
137  top: 5px;
138  border: 1px solid #000;
139  border-radius: var(--elgg-border-radius-medium);
140 }
141 
142 .elgg-input-color {
143  width: 4.5rem;
144 }
145 
146 <?php
147 echo elgg_view('elements/misc/checkbox_switch.css');
148 ?>
149 
150 select {
151  max-width: 100%;
152  border: 1px solid var(--elgg-border-color-mild);
153  color: var(--elgg-text-color-strong);
154  background: var(--elgg-background-color-input);
155  padding: 0.25rem 0.5rem;
156  line-height: 1.75rem;
157  vertical-align: middle;
158  border-radius: var(--elgg-border-radius-medium);
159 
160  &:not([multiple]) {
161  height: 2.5rem;
162  }
163 }
164 
165 .elgg-form-account {
166  margin-bottom: 1rem;
167 }
168 
169 .elgg-input-radios {
170  &.elgg-vertical {
171  display: flex;
172  flex-direction: column;
173  gap: 4px;
174  }
175 
176  label {
177  font-weight: normal;
178  font-size: 100%;
179 
180  display: flex;
181  align-items: center;
182  }
183 }
184 
185 .elgg-input-checkboxes {
186  label {
187  font-weight: normal;
188  font-size: 100%;
189  line-height: inherit;
190  }
191 
192  &.elgg-horizontal label > .elgg-input-checkbox {
193  vertical-align: baseline;
194  }
195 }
196 
197 .elgg-form-login,
198 .elgg-form-account {
199  max-width: 40rem;
200  margin: 0 auto;
201 }
202 
203 .elgg-fieldset {
204  display: flex;
205  flex-direction: column;
206  gap: 1rem;
207 
208  &.elgg-fieldset-has-legend {
209  border: 1px solid var(--elgg-border-color-soft);
210  padding: 1rem;
211  }
212 }
213 
214 @media screen and (min-width: 30rem) {
215  .elgg-field {
216  &.elgg-field-stretch {
217  flex-basis: 1%;
218  flex-grow: 1;
219 
220  > .elgg-field-input {
221  width: 100%;
222  }
223  }
224 
225  &.elgg-field-horizontal {
226  display: flex;
227  flex-direction: row;
228  align-items: baseline;
229  column-gap: 1rem;
230 
231  > .elgg-field-label {
232  align-items: center;
233  display: flex;
234  flex-shrink: 0;
235  }
236  }
237  }
238 
239  .elgg-fieldset-horizontal {
240  flex-direction: row;
241 
242  > .elgg-field {
243  vertical-align: top;
244  }
245 
246  &.elgg-fieldset-wrap {
247  flex-wrap: wrap;
248  }
249 
250  &.elgg-justify-right {
251  justify-content: flex-end;
252  }
253 
254  &.elgg-justify-center {
255  justify-content: center;
256  }
257  }
258 }
259 
260 <?php
261 echo elgg_view('elements/components/autocomplete.css', $vars);
262 echo elgg_view('elements/components/datepicker.css', $vars);
263 echo elgg_view('input/entitypicker.css', $vars);
264 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