active_admin_prism 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/CHANGELOG.md +133 -0
- data/INTEGRATION.md +1012 -0
- data/LICENSE.txt +21 -0
- data/README.md +319 -0
- data/app/assets/javascripts/active_admin_prism/prism.js +1 -0
- data/app/assets/stylesheets/active_admin_prism/_variable_overrides.scss +43 -0
- data/app/assets/stylesheets/active_admin_prism/prism.css +1 -0
- data/app/views/active_admin/devise/confirmations/new.html.erb +26 -0
- data/app/views/active_admin/devise/passwords/edit.html.erb +29 -0
- data/app/views/active_admin/devise/passwords/new.html.erb +26 -0
- data/app/views/active_admin/devise/registrations/new.html.erb +32 -0
- data/app/views/active_admin/devise/sessions/new.html.erb +37 -0
- data/app/views/active_admin/devise/shared/_brand.html.erb +34 -0
- data/app/views/active_admin/devise/unlocks/new.html.erb +25 -0
- data/js-src/prism.js +270 -0
- data/lib/active_admin/views/filters_sidebar.rb +69 -0
- data/lib/active_admin/views/flash_messages.rb +77 -0
- data/lib/active_admin/views/index_table_actions.rb +46 -0
- data/lib/active_admin/views/prism_sidebar.rb +212 -0
- data/lib/active_admin_prism/configuration.rb +180 -0
- data/lib/active_admin_prism/engine.rb +18 -0
- data/lib/active_admin_prism/version.rb +5 -0
- data/lib/active_admin_prism.rb +33 -0
- data/lib/formtastic/inputs/prism_toggle_input.rb +31 -0
- data/lib/generators/active_admin_prism/error_pages/error_pages_generator.rb +49 -0
- data/lib/generators/active_admin_prism/error_pages/templates/404.html +164 -0
- data/lib/generators/active_admin_prism/error_pages/templates/500.html +173 -0
- data/lib/generators/active_admin_prism/install/install_generator.rb +69 -0
- data/lib/prism_icons.rb +82 -0
- data/lib/prism_login_helper.rb +31 -0
- data/lib/prism_toggle_tag.rb +35 -0
- data/scss-src/_base.scss +281 -0
- data/scss-src/_buttons.scss +134 -0
- data/scss-src/_forms.scss +272 -0
- data/scss-src/_icons.scss +27 -0
- data/scss-src/_login.scss +306 -0
- data/scss-src/_panels.scss +249 -0
- data/scss-src/_sidebar.scss +479 -0
- data/scss-src/_tables.scss +142 -0
- data/scss-src/_variables.scss +101 -0
- data/scss-src/prism.scss +15 -0
- metadata +157 -0
data/scss-src/_base.scss
ADDED
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
// Global resets/typography layered on top of ActiveAdmin's own base.scss.
|
|
2
|
+
// Kept intentionally small — we're reskinning existing markup, not replacing
|
|
3
|
+
// ActiveAdmin's structural CSS.
|
|
4
|
+
|
|
5
|
+
body {
|
|
6
|
+
background: $prism-bg-page;
|
|
7
|
+
color: $prism-text-body;
|
|
8
|
+
font-family: $prism-font-family;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
#active_admin_content {
|
|
12
|
+
h2,
|
|
13
|
+
h3 {
|
|
14
|
+
color: $prism-text-heading;
|
|
15
|
+
font-weight: 600;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
a {
|
|
20
|
+
color: $prism-color-primary;
|
|
21
|
+
|
|
22
|
+
&:hover {
|
|
23
|
+
color: $prism-color-primary-dark;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
#title_bar {
|
|
28
|
+
background: transparent;
|
|
29
|
+
border: none;
|
|
30
|
+
box-shadow: none;
|
|
31
|
+
text-shadow: none;
|
|
32
|
+
padding: 10px 10px 8px;
|
|
33
|
+
|
|
34
|
+
h2#page_title {
|
|
35
|
+
color: $prism-text-heading;
|
|
36
|
+
font-weight: 700;
|
|
37
|
+
font-size: 1.6em;
|
|
38
|
+
letter-spacing: -0.01em;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
#footer {
|
|
43
|
+
color: $prism-text-muted;
|
|
44
|
+
font-size: 0.85em;
|
|
45
|
+
padding: 10px;
|
|
46
|
+
border-top: 1px solid $prism-border-color;
|
|
47
|
+
|
|
48
|
+
a {
|
|
49
|
+
color: $prism-text-muted;
|
|
50
|
+
text-decoration: underline;
|
|
51
|
+
|
|
52
|
+
&:hover {
|
|
53
|
+
color: $prism-color-primary;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// Flash messages — ActiveAdmin renders these with a heavy full-width
|
|
59
|
+
// gradient bar (padding: 13px 30px 11px, font-size: 1.1em); this reskins
|
|
60
|
+
// them into a compact, inset, color-coded banner. ".flashes" itself gets
|
|
61
|
+
// its grid placement from _sidebar.scss (must be explicit — see comment
|
|
62
|
+
// there on why leaving it to auto-placement broke the layout).
|
|
63
|
+
.flashes {
|
|
64
|
+
padding: 10px 10px 0;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// "body.active_admin .flash" (not a flat ".flash") on purpose: ActiveAdmin
|
|
68
|
+
// itself styles flashes via "body.logged_in .flash" AND
|
|
69
|
+
// "body.logged_out .flash" (active_admin/components/_flash_messages.scss)
|
|
70
|
+
// — both specificity (0,2,1), strictly higher than a flat ".flash" rule's
|
|
71
|
+
// (0,1,0), so a flat rule here loses on the login page every time and
|
|
72
|
+
// loses on the main app too whenever a property collides (background,
|
|
73
|
+
// color, padding, border are exactly what both of AA's rules set). Both
|
|
74
|
+
// "logged_in" and "logged_out" bodies always carry an "active_admin"
|
|
75
|
+
// class too (hardcoded in layouts/active_admin_logged_out.html.erb, and
|
|
76
|
+
// added by this gem's own body_classes override for the main app layout —
|
|
77
|
+
// see lib/active_admin/views/flash_messages.rb), so "body.active_admin
|
|
78
|
+
// .flash" ties AA's specificity exactly (0,2,1) instead of losing to it —
|
|
79
|
+
// and since prism.css always loads after active_admin.css (see
|
|
80
|
+
// INTEGRATION.md's "Verifying the install"), that tie resolves in our
|
|
81
|
+
// favor via load order on every page, logged in or out.
|
|
82
|
+
body.active_admin .flash {
|
|
83
|
+
position: relative;
|
|
84
|
+
display: flex;
|
|
85
|
+
align-items: flex-start;
|
|
86
|
+
gap: 12px;
|
|
87
|
+
background: $prism-bg-page;
|
|
88
|
+
border: 1px solid $prism-border-color;
|
|
89
|
+
border-left: 3px solid $prism-text-muted;
|
|
90
|
+
border-radius: $prism-radius-sm;
|
|
91
|
+
box-shadow: none;
|
|
92
|
+
text-shadow: none;
|
|
93
|
+
color: $prism-text-heading;
|
|
94
|
+
font-size: 0.9em;
|
|
95
|
+
font-weight: 600;
|
|
96
|
+
line-height: 1.4;
|
|
97
|
+
padding: 10px 16px;
|
|
98
|
+
margin-bottom: 0;
|
|
99
|
+
opacity: 1;
|
|
100
|
+
transform: translateY(0) scale(1);
|
|
101
|
+
// 320ms/cubic-bezier here matches Configuration#flash_transition_ms's
|
|
102
|
+
// default and is overridden inline by prism.js (transition-duration) if a
|
|
103
|
+
// host configures a different value — see that file's flash-dismiss IIFE.
|
|
104
|
+
transition: opacity 320ms cubic-bezier(0.4, 0, 0.2, 1),
|
|
105
|
+
transform 320ms cubic-bezier(0.4, 0, 0.2, 1);
|
|
106
|
+
|
|
107
|
+
// Toggled by prism.js — auto-dismissed after flash_auto_dismiss_seconds,
|
|
108
|
+
// or on clicking .prism-flash-dismiss — before being removed from the DOM
|
|
109
|
+
// outright once the transition finishes.
|
|
110
|
+
&.prism-flash-hide {
|
|
111
|
+
opacity: 0;
|
|
112
|
+
transform: translateY(-6px) scale(0.98);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
&.flash_notice {
|
|
116
|
+
background: $prism-color-success-light;
|
|
117
|
+
border-left-color: $prism-color-success;
|
|
118
|
+
color: darken($prism-color-success, 20%);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
&.flash_error,
|
|
122
|
+
&.flash_alert {
|
|
123
|
+
background: $prism-color-danger-light;
|
|
124
|
+
border-left-color: $prism-color-danger;
|
|
125
|
+
color: darken($prism-color-danger, 10%);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.prism-flash-message {
|
|
130
|
+
flex: 1 1 auto;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.prism-flash-dismiss {
|
|
134
|
+
flex: 0 0 auto;
|
|
135
|
+
display: inline-flex;
|
|
136
|
+
align-items: center;
|
|
137
|
+
justify-content: center;
|
|
138
|
+
width: 22px;
|
|
139
|
+
height: 22px;
|
|
140
|
+
margin: -2px -4px -2px 0;
|
|
141
|
+
padding: 0;
|
|
142
|
+
border: none;
|
|
143
|
+
border-radius: $prism-radius-sm;
|
|
144
|
+
background: transparent !important;
|
|
145
|
+
color: inherit !important;
|
|
146
|
+
opacity: 0.6;
|
|
147
|
+
cursor: pointer;
|
|
148
|
+
transition: opacity $prism-transition-fast, background $prism-transition-fast;
|
|
149
|
+
|
|
150
|
+
&:hover {
|
|
151
|
+
opacity: 1;
|
|
152
|
+
background: rgba(0, 0, 0, 0.06) !important;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.prism-flash-dismiss-icon {
|
|
157
|
+
display: block;
|
|
158
|
+
margin: 0;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
// The delete/batch-action confirmation dialog ActiveAdmin renders via
|
|
162
|
+
// jQuery UI ($.fn.dialog, see active_admin/base.js) — completely separate
|
|
163
|
+
// markup from anything else on the page, so it needs its own reskin.
|
|
164
|
+
.ui-widget-overlay {
|
|
165
|
+
background: rgba(15, 18, 26, 0.45);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.ui-dialog {
|
|
169
|
+
background: $prism-bg-card;
|
|
170
|
+
border: 1px solid $prism-border-color;
|
|
171
|
+
border-radius: $prism-radius;
|
|
172
|
+
box-shadow: $prism-shadow-popover;
|
|
173
|
+
padding: 0;
|
|
174
|
+
overflow: hidden;
|
|
175
|
+
// jQuery UI calls `.focus()` on this element when it opens
|
|
176
|
+
// (_focusTabbable override in active_admin/base.js), which otherwise
|
|
177
|
+
// triggers the browser's default focus ring around the whole dialog.
|
|
178
|
+
outline: none;
|
|
179
|
+
|
|
180
|
+
&:focus {
|
|
181
|
+
outline: none;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
.ui-dialog-titlebar {
|
|
185
|
+
background: $prism-bg-card;
|
|
186
|
+
border: none;
|
|
187
|
+
border-bottom: 1px solid $prism-border-color;
|
|
188
|
+
box-shadow: none;
|
|
189
|
+
text-shadow: none;
|
|
190
|
+
color: $prism-text-heading;
|
|
191
|
+
font-weight: 700;
|
|
192
|
+
padding: 16px 20px;
|
|
193
|
+
|
|
194
|
+
span {
|
|
195
|
+
color: inherit;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
// A plain confirm (no batch-action inputs) renders an *empty* <ul> here.
|
|
200
|
+
// Padding lives on the <li> (not on `form`/`ul`), so that empty case
|
|
201
|
+
// collapses to zero height instead of leaving an awkward blank gap
|
|
202
|
+
// between the title and the button pane.
|
|
203
|
+
form {
|
|
204
|
+
padding: 0;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
ul {
|
|
208
|
+
margin: 0;
|
|
209
|
+
padding: 0;
|
|
210
|
+
|
|
211
|
+
li {
|
|
212
|
+
padding: 10px 20px;
|
|
213
|
+
margin: 0;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
label {
|
|
218
|
+
color: $prism-text-body;
|
|
219
|
+
font-weight: 600;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
.ui-dialog-buttonpane {
|
|
223
|
+
background: $prism-bg-page;
|
|
224
|
+
padding: 12px 20px;
|
|
225
|
+
display: flex;
|
|
226
|
+
justify-content: flex-end;
|
|
227
|
+
gap: 8px;
|
|
228
|
+
|
|
229
|
+
.ui-dialog-buttonset {
|
|
230
|
+
display: flex;
|
|
231
|
+
gap: 8px;
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
// AA's own modal_dialog.scss targets these same buttons with
|
|
236
|
+
// "button { @include dark-button } button:last-child { @include
|
|
237
|
+
// light-button }" — :last-child has one more selector-class of
|
|
238
|
+
// specificity than a bare "button" rule, so it beats a flat override
|
|
239
|
+
// regardless of load order. Matching :first-child/:last-child here
|
|
240
|
+
// (rather than a single flat rule) is what makes OK and Cancel actually
|
|
241
|
+
// both pick up Prism's shape instead of Cancel keeping AA's pill-shaped
|
|
242
|
+
// light-button (border-radius: 200px).
|
|
243
|
+
.ui-dialog-buttonpane button,
|
|
244
|
+
.ui-dialog-buttonset button {
|
|
245
|
+
margin: 0;
|
|
246
|
+
|
|
247
|
+
&:first-child {
|
|
248
|
+
@include prism-button-primary;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
&:last-child {
|
|
252
|
+
@include prism-button-secondary;
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
.breadcrumb {
|
|
258
|
+
font-size: 0.85em;
|
|
259
|
+
font-weight: 600;
|
|
260
|
+
letter-spacing: 0.02em;
|
|
261
|
+
text-transform: uppercase;
|
|
262
|
+
color: $prism-text-muted;
|
|
263
|
+
margin-bottom: 6px;
|
|
264
|
+
|
|
265
|
+
a,
|
|
266
|
+
a:link,
|
|
267
|
+
a:visited,
|
|
268
|
+
a:active {
|
|
269
|
+
color: $prism-text-muted;
|
|
270
|
+
text-decoration: none;
|
|
271
|
+
|
|
272
|
+
&:hover {
|
|
273
|
+
color: $prism-color-primary;
|
|
274
|
+
text-decoration: none;
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
.breadcrumb_sep {
|
|
279
|
+
color: $prism-border-color-strong;
|
|
280
|
+
}
|
|
281
|
+
}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
// Buttons: ActiveAdmin ships two visual weights (dark-button / light-button)
|
|
2
|
+
// applied via deeply-nested, sometimes ID-scoped selectors
|
|
3
|
+
// (e.g. "#title_bar .action_items span.action_item > a"). To reliably win
|
|
4
|
+
// the cascade we mirror those exact selector paths here rather than relying
|
|
5
|
+
// on a flat, lower-specificity override.
|
|
6
|
+
//
|
|
7
|
+
// prism-button-primary / prism-button-secondary are defined in
|
|
8
|
+
// _variables.scss (loaded first) since _base.scss's flash/dialog styling
|
|
9
|
+
// also needs them.
|
|
10
|
+
|
|
11
|
+
// Generic buttons (form submits, plain `.button` links) — primary style.
|
|
12
|
+
a.button,
|
|
13
|
+
a:link.button,
|
|
14
|
+
a:visited.button,
|
|
15
|
+
input[type="submit"],
|
|
16
|
+
input[type="button"],
|
|
17
|
+
button,
|
|
18
|
+
form input[type="submit"],
|
|
19
|
+
form input[type="button"],
|
|
20
|
+
form button {
|
|
21
|
+
@include prism-button-primary;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
a.button.danger,
|
|
25
|
+
input[type="submit"].danger,
|
|
26
|
+
form input[type="submit"].danger {
|
|
27
|
+
background: $prism-color-danger;
|
|
28
|
+
border-color: $prism-color-danger;
|
|
29
|
+
|
|
30
|
+
&:hover {
|
|
31
|
+
background: darken($prism-color-danger, 8%);
|
|
32
|
+
border-color: darken($prism-color-danger, 8%);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// The page-level "New Resource" action button(s) in the title bar — same
|
|
37
|
+
// selector path ActiveAdmin uses (it's ID-scoped, so a flatter selector
|
|
38
|
+
// would lose the cascade regardless of load order).
|
|
39
|
+
#title_bar .action_items span.action_item > a,
|
|
40
|
+
#title_bar .action_items span.action_item > .dropdown_menu > a {
|
|
41
|
+
@include prism-button-primary;
|
|
42
|
+
padding: 9px 16px;
|
|
43
|
+
margin: 0;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// Secondary / lower-emphasis buttons: batch actions trigger, pagination,
|
|
47
|
+
// "clear filters", "cancel" form link.
|
|
48
|
+
.dropdown_menu .dropdown_menu_button,
|
|
49
|
+
form.filter_form a.clear_filters_btn,
|
|
50
|
+
fieldset.buttons li.cancel a,
|
|
51
|
+
fieldset.actions li.cancel a,
|
|
52
|
+
.pagination a,
|
|
53
|
+
.pagination span.page.current,
|
|
54
|
+
.pagination_per_page select {
|
|
55
|
+
@include prism-button-secondary;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.dropdown_menu .dropdown_menu_button {
|
|
59
|
+
padding-right: 26px !important;
|
|
60
|
+
|
|
61
|
+
&::before,
|
|
62
|
+
&::after {
|
|
63
|
+
border-color: $prism-text-muted transparent;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// The wrapper AA renders behind an opened dropdown (Batch Actions) list
|
|
68
|
+
// defaults to a dark-gray gradient card ($primary-color); the list items
|
|
69
|
+
// inside it default to AA's blue-gray "highlight-gradient" on :hover/:active.
|
|
70
|
+
// Neither is touched by the button mixins above, so both need an explicit
|
|
71
|
+
// reset here — this is almost certainly the "black/grey on hover" being
|
|
72
|
+
// reported, not the buttons themselves.
|
|
73
|
+
.dropdown_menu_list_wrapper {
|
|
74
|
+
border-radius: $prism-radius-sm;
|
|
75
|
+
box-shadow: $prism-shadow-popover;
|
|
76
|
+
border: 1px solid $prism-border-color;
|
|
77
|
+
background: $prism-bg-card;
|
|
78
|
+
padding: 4px;
|
|
79
|
+
|
|
80
|
+
.dropdown_menu_list {
|
|
81
|
+
background: transparent;
|
|
82
|
+
border: none;
|
|
83
|
+
box-shadow: none;
|
|
84
|
+
border-radius: 0;
|
|
85
|
+
|
|
86
|
+
li {
|
|
87
|
+
border-bottom: none;
|
|
88
|
+
|
|
89
|
+
a {
|
|
90
|
+
border-radius: $prism-radius-sm;
|
|
91
|
+
color: $prism-text-body;
|
|
92
|
+
font-weight: 600;
|
|
93
|
+
text-align: left;
|
|
94
|
+
text-shadow: none;
|
|
95
|
+
padding: 8px 12px;
|
|
96
|
+
|
|
97
|
+
&:hover,
|
|
98
|
+
&:active {
|
|
99
|
+
background: $prism-color-primary-light;
|
|
100
|
+
color: $prism-color-primary-dark;
|
|
101
|
+
text-shadow: none;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
&:first-child a,
|
|
106
|
+
&:last-child a {
|
|
107
|
+
border-radius: $prism-radius-sm;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.pagination {
|
|
114
|
+
a,
|
|
115
|
+
span.page.current {
|
|
116
|
+
border-radius: $prism-radius-sm;
|
|
117
|
+
margin-right: 4px;
|
|
118
|
+
padding: 5px 11px;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
span.page.current {
|
|
122
|
+
background: $prism-color-primary-light;
|
|
123
|
+
border-color: $prism-color-primary-light;
|
|
124
|
+
color: $prism-color-primary-dark;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.pagination_information {
|
|
129
|
+
color: $prism-text-muted;
|
|
130
|
+
|
|
131
|
+
b {
|
|
132
|
+
color: $prism-text-heading;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
form {
|
|
2
|
+
fieldset {
|
|
3
|
+
&.inputs {
|
|
4
|
+
background: $prism-bg-card;
|
|
5
|
+
border: 1px solid $prism-border-color;
|
|
6
|
+
border-radius: $prism-radius;
|
|
7
|
+
padding: 20px;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
legend span {
|
|
11
|
+
color: $prism-text-heading;
|
|
12
|
+
font-weight: 700;
|
|
13
|
+
font-size: 1.05em;
|
|
14
|
+
text-transform: none;
|
|
15
|
+
letter-spacing: normal;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
ol > li label {
|
|
19
|
+
color: $prism-text-body;
|
|
20
|
+
font-weight: 600;
|
|
21
|
+
font-size: 0.9em;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
input[type="text"],
|
|
26
|
+
input[type="password"],
|
|
27
|
+
input[type="email"],
|
|
28
|
+
input[type="number"],
|
|
29
|
+
input[type="url"],
|
|
30
|
+
input[type="tel"],
|
|
31
|
+
input[type="date"],
|
|
32
|
+
input[type="time"],
|
|
33
|
+
input[type="search"],
|
|
34
|
+
select,
|
|
35
|
+
textarea {
|
|
36
|
+
border: 1px solid $prism-border-color-strong;
|
|
37
|
+
border-radius: $prism-radius-sm;
|
|
38
|
+
color: $prism-text-heading;
|
|
39
|
+
padding: 9px 12px;
|
|
40
|
+
box-shadow: none;
|
|
41
|
+
transition: border-color $prism-transition-fast, box-shadow $prism-transition-fast;
|
|
42
|
+
|
|
43
|
+
&:focus {
|
|
44
|
+
border-color: $prism-color-primary;
|
|
45
|
+
box-shadow: 0 0 0 3px rgba($prism-color-primary, 0.15);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
fieldset > ol > li {
|
|
50
|
+
&.error {
|
|
51
|
+
input[type="text"],
|
|
52
|
+
input[type="password"],
|
|
53
|
+
input[type="email"],
|
|
54
|
+
input[type="number"],
|
|
55
|
+
input[type="url"],
|
|
56
|
+
input[type="tel"],
|
|
57
|
+
textarea,
|
|
58
|
+
select {
|
|
59
|
+
border-color: $prism-color-danger;
|
|
60
|
+
|
|
61
|
+
&:focus {
|
|
62
|
+
box-shadow: 0 0 0 3px rgba($prism-color-danger, 0.15);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
p.inline-errors {
|
|
68
|
+
color: $prism-color-danger;
|
|
69
|
+
font-weight: 600;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
ul.errors {
|
|
74
|
+
background: $prism-color-danger-light;
|
|
75
|
+
color: $prism-color-danger;
|
|
76
|
+
border-radius: $prism-radius-sm;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// Checkboxes & radios: hide the native control visually but keep it
|
|
80
|
+
// focusable/clickable (opacity, not display:none) and draw a custom box
|
|
81
|
+
// with ::before, matching the reference "Checkboxes / Radios" panel.
|
|
82
|
+
input[type="checkbox"],
|
|
83
|
+
input[type="radio"] {
|
|
84
|
+
appearance: none;
|
|
85
|
+
position: relative;
|
|
86
|
+
width: 18px;
|
|
87
|
+
height: 18px;
|
|
88
|
+
margin: 0 8px 0 0;
|
|
89
|
+
border: 1px solid $prism-border-color-strong;
|
|
90
|
+
background: $prism-bg-card;
|
|
91
|
+
vertical-align: middle;
|
|
92
|
+
cursor: pointer;
|
|
93
|
+
flex: 0 0 auto;
|
|
94
|
+
|
|
95
|
+
&:checked {
|
|
96
|
+
background: $prism-color-primary;
|
|
97
|
+
border-color: $prism-color-primary;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
&:checked::after {
|
|
101
|
+
content: "";
|
|
102
|
+
position: absolute;
|
|
103
|
+
left: 5px;
|
|
104
|
+
top: 1px;
|
|
105
|
+
width: 5px;
|
|
106
|
+
height: 10px;
|
|
107
|
+
border: solid $prism-text-inverse;
|
|
108
|
+
border-width: 0 2px 2px 0;
|
|
109
|
+
transform: rotate(45deg);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
&:focus-visible {
|
|
113
|
+
box-shadow: 0 0 0 3px rgba($prism-color-primary, 0.2);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
input[type="checkbox"] {
|
|
118
|
+
border-radius: 5px;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
input[type="radio"] {
|
|
122
|
+
border-radius: 50%;
|
|
123
|
+
|
|
124
|
+
&:checked::after {
|
|
125
|
+
left: 5px;
|
|
126
|
+
top: 5px;
|
|
127
|
+
width: 6px;
|
|
128
|
+
height: 6px;
|
|
129
|
+
border: none;
|
|
130
|
+
border-radius: 50%;
|
|
131
|
+
background: $prism-text-inverse;
|
|
132
|
+
transform: none;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
fieldset > ol > li.boolean label {
|
|
137
|
+
display: flex;
|
|
138
|
+
align-items: center;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
// Toggle switch (opt-in: f.input :x, as: :prism_toggle)
|
|
142
|
+
label.prism-toggle {
|
|
143
|
+
display: flex;
|
|
144
|
+
align-items: center;
|
|
145
|
+
gap: 10px;
|
|
146
|
+
|
|
147
|
+
input.prism-toggle-input {
|
|
148
|
+
appearance: none;
|
|
149
|
+
position: relative;
|
|
150
|
+
width: 0;
|
|
151
|
+
height: 0;
|
|
152
|
+
margin: 0;
|
|
153
|
+
border: none;
|
|
154
|
+
|
|
155
|
+
&:checked ~ .prism-toggle-track {
|
|
156
|
+
background: $prism-color-primary;
|
|
157
|
+
|
|
158
|
+
&::after {
|
|
159
|
+
transform: translateX(16px);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.buttons,
|
|
166
|
+
.actions {
|
|
167
|
+
input[type="submit"],
|
|
168
|
+
input[type="button"],
|
|
169
|
+
button {
|
|
170
|
+
margin-right: 10px;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
// Shared pill+thumb visual for the toggle switch — used both by the form
|
|
176
|
+
// input above (state driven by the sibling checkbox's :checked) and by the
|
|
177
|
+
// read-only prism_toggle_tag(value) helper below (state driven by a plain
|
|
178
|
+
// "on"/"off" class, since there's no real input on index/show pages).
|
|
179
|
+
.prism-toggle-track {
|
|
180
|
+
position: relative;
|
|
181
|
+
display: inline-block;
|
|
182
|
+
width: 38px;
|
|
183
|
+
height: 22px;
|
|
184
|
+
border-radius: $prism-radius-pill;
|
|
185
|
+
background: $prism-border-color-strong;
|
|
186
|
+
transition: background $prism-transition-fast;
|
|
187
|
+
flex: 0 0 auto;
|
|
188
|
+
|
|
189
|
+
&::after {
|
|
190
|
+
content: "";
|
|
191
|
+
position: absolute;
|
|
192
|
+
top: 2px;
|
|
193
|
+
left: 2px;
|
|
194
|
+
width: 18px;
|
|
195
|
+
height: 18px;
|
|
196
|
+
border-radius: 50%;
|
|
197
|
+
background: $prism-bg-card;
|
|
198
|
+
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
|
|
199
|
+
transition: transform $prism-transition-fast;
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
// Read-only toggle tag for index columns / attributes_table rows — see
|
|
204
|
+
// prism_toggle_tag(value) in lib/prism_toggle_tag.rb.
|
|
205
|
+
.prism-toggle-tag {
|
|
206
|
+
display: inline-flex;
|
|
207
|
+
align-items: center;
|
|
208
|
+
vertical-align: middle;
|
|
209
|
+
|
|
210
|
+
&.on .prism-toggle-track {
|
|
211
|
+
background: $prism-color-primary;
|
|
212
|
+
|
|
213
|
+
&::after {
|
|
214
|
+
transform: translateX(16px);
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
// Filters panel — this lives in ActiveAdmin's own #sidebar/.sidebar_section
|
|
220
|
+
// (the built-in right-hand content sidebar, unrelated to Prism's left nav).
|
|
221
|
+
// Its label style is brought in line with the rest of the theme, and its
|
|
222
|
+
// select/input widths — hard-coded by AA in pixels against its own default
|
|
223
|
+
// $sidebar-width — are made fluid so they can't misalign if that width
|
|
224
|
+
// ever differs from AA's assumption.
|
|
225
|
+
.sidebar_section label {
|
|
226
|
+
color: $prism-text-muted;
|
|
227
|
+
font-size: 0.72em;
|
|
228
|
+
font-weight: 700;
|
|
229
|
+
letter-spacing: 0.06em;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
.sidebar_section select,
|
|
233
|
+
.sidebar_section input[type="text"],
|
|
234
|
+
.sidebar_section input[type="number"] {
|
|
235
|
+
box-sizing: border-box;
|
|
236
|
+
width: 100%;
|
|
237
|
+
max-width: 100%;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
form.filter_form {
|
|
241
|
+
.filter_form_field {
|
|
242
|
+
margin-bottom: 14px;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
.filter_form_field.select_and_search {
|
|
246
|
+
display: flex;
|
|
247
|
+
gap: 8px;
|
|
248
|
+
|
|
249
|
+
select,
|
|
250
|
+
input[type="text"] {
|
|
251
|
+
width: auto;
|
|
252
|
+
min-width: 0;
|
|
253
|
+
flex: 1 1 0;
|
|
254
|
+
margin-left: 0;
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
.filter_form_field.filter_date_range {
|
|
259
|
+
display: flex;
|
|
260
|
+
gap: 8px;
|
|
261
|
+
|
|
262
|
+
input[type="text"] {
|
|
263
|
+
width: auto;
|
|
264
|
+
min-width: 0;
|
|
265
|
+
flex: 1 1 0;
|
|
266
|
+
|
|
267
|
+
+ input {
|
|
268
|
+
margin-left: 0;
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
.prism-icon,
|
|
2
|
+
.prism-nav-icon,
|
|
3
|
+
.prism-chevron,
|
|
4
|
+
.prism-action-icon {
|
|
5
|
+
display: inline-block;
|
|
6
|
+
vertical-align: middle;
|
|
7
|
+
flex-shrink: 0;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.prism-icon {
|
|
11
|
+
margin-right: 6px;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
// Standard "visually hidden but present for assistive tech" utility —
|
|
15
|
+
// used to keep the localized View/Edit/Delete label available to screen
|
|
16
|
+
// readers once the visible text is replaced by an icon.
|
|
17
|
+
.prism-visually-hidden {
|
|
18
|
+
position: absolute;
|
|
19
|
+
width: 1px;
|
|
20
|
+
height: 1px;
|
|
21
|
+
padding: 0;
|
|
22
|
+
margin: -1px;
|
|
23
|
+
overflow: hidden;
|
|
24
|
+
clip: rect(0, 0, 0, 0);
|
|
25
|
+
white-space: nowrap;
|
|
26
|
+
border: 0;
|
|
27
|
+
}
|