active_admin_theme 3.0.0 → 3.1.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c393033738086398f691d3a9e754ece92f10ab6c647dd0357da38fc5167e4368
4
- data.tar.gz: 6733dc12d9ceca058b15072be3826989334e106be7db5fd273017871e258ec41
3
+ metadata.gz: 9acbb41d69f18ef3ba70a6b4da01ab1a85328e033f7479db96196205908b769a
4
+ data.tar.gz: 6bb46419bd8a22379b18f25911e0a6265f362cee313b5b0ec6ea8c1e6c66e900
5
5
  SHA512:
6
- metadata.gz: 2c9c40332a46b50fd79f0d1959a2cb25c4ff23ac12be1dce88b721cfcafcbc798b9971f6cb17a4ee088985a08fdac8e1cba55275579bee8ed892eb50e23a051c
7
- data.tar.gz: e1973bc1eb334a1f14cb4dd46094b1c802f0074243ac89ff30aaea894b84a744a5cce42b517feb63cc083b429517fd851ac41dc391a686a9d60cb732ff170e18
6
+ metadata.gz: 4111c99001eeb83c4e40ae480e30f4e04e40b91385308dc1fba03e55a9f1c2eec848543de51c0cfe716a0780a3c5d9cfa70aa9c379b85f18b24298755b252276
7
+ data.tar.gz: 2637d37a333a34362e022f2e97090384150fc2d38de4131c3b6b322e999f375ab82dd0fdeb9a671f84b2870c77c6e18fb2e683fc75db8b59fa7bf4c804818359
data/README.md CHANGED
@@ -35,7 +35,7 @@ Or add manually to `package.json`:
35
35
 
36
36
  ```
37
37
  "dependencies": {
38
- "@activeadmin-plugins/active_admin_theme": "^3.0.0"
38
+ "@activeadmin-plugins/active_admin_theme": "^3.1.1"
39
39
  }
40
40
  ```
41
41
  and execute:
@@ -176,8 +176,19 @@ applies it in the others.
176
176
 
177
177
  ### Upgrading
178
178
 
179
- Two things changed shape in this release and are worth knowing if you already
180
- set variables:
179
+ #### 3.1.0
180
+
181
+ * Status tag fills are darker, so the label can be white and still clear 4.5:1 —
182
+ it was black on mid-tone fills before. Each fill is a variable now
183
+ (`$skinStatusTagOkColor` and the four beside it), and
184
+ `$skinStatusTagTextColor: #000000;` restores the old label with the fills
185
+ you choose.
186
+ * Index-table column headings take `$skinTextColor` rather than a muted grey,
187
+ so a heading reads as strongly as the column under it.
188
+
189
+ #### 3.0.0
190
+
191
+ Three things changed shape and are worth knowing if you already set variables:
181
192
 
182
193
  * Dropdown panels — the title-bar menu, the batch-actions menu and the
183
194
  table-tools menus — now follow the surface palette (`$skinSurfaceColor` and
@@ -262,7 +273,13 @@ set variables:
262
273
  | `$skinTabInactiveColor` / `$skinTabInactiveColorDark` | `#f7f9fb` / `#161a1e` | inactive tab fill |
263
274
  | `$skinActiveTabTextColor` / `$skinActiveTabTextColorDark` | `$skinMainSecondColor` / `#7cc0ec` | selected tab label |
264
275
  | `$skinInactiveTabTextColor` / `$skinInactiveTabTextColorDark` | `#5e6469` / `#b0b8c2` | inactive tab label |
265
- | `$skinTableHeaderTextColor` / `$skinTableHeaderTextColorDark` | `#5e6469` / `#dde2e8` | index-table column header text |
276
+ | `$skinTableHeaderTextColor` / `$skinTableHeaderTextColorDark` | `$skinTextColor` / `$skinTextColorDark` | index-table column header text; the body text colour, so headings read as strongly as the rows |
277
+ | `$skinStatusTagTextColor` | `#ffffff` | label inside a filled status tag; `empty` / `unknown` / `none` have no fill and keep `$skinTextMutedColor` |
278
+ | `$skinStatusTagNeutralColor` | `#707681` | unclassified tags: `No`, protocol tags |
279
+ | `$skinStatusTagOkColor` | `#5e7e63` | `ok` `published` `complete` `completed` `green` `yes` |
280
+ | `$skinStatusTagNoticeColor` | `#3874d2` | `notice` `blue` |
281
+ | `$skinStatusTagWarnColor` | `#9e6c15` | `warn` `warning` `orange` |
282
+ | `$skinStatusTagErrorColor` | `#ce483b` | `error` `errored` `red` |
266
283
  | `$skinTabPaddingY` | `8px` | tab height |
267
284
  | `$skinTabPaddingX` | `15px` | tab label horizontal padding (text → border) |
268
285
 
@@ -129,8 +129,20 @@ $skinActiveTabTextColorDark: #7cc0ec!default;
129
129
  $skinInactiveTabTextColor: #5e6469!default;
130
130
  $skinInactiveTabTextColorDark: #b0b8c2!default;
131
131
  // Index-table column header text, one colour for sortable and plain headers.
132
- $skinTableHeaderTextColor: #5e6469!default;
133
- $skinTableHeaderTextColorDark: #dde2e8!default;
132
+ $skinTableHeaderTextColor: $skinTextColor!default;
133
+ $skinTableHeaderTextColorDark: $skinTextColorDark!default;
134
+
135
+ // Status tags. The label is the same on every filled tag in both modes. The
136
+ // fills below are dark enough to carry a white one: every one of the five is
137
+ // at least 4.53 against it. The mid-tone fills this palette replaces ran from
138
+ // 2.35 to 3.78, under the 4.5 WCAG AA asks of text this small, which is why
139
+ // they moved rather than the label.
140
+ $skinStatusTagTextColor: #ffffff!default;
141
+ $skinStatusTagNeutralColor: #707681!default; // "No", protocol tags, anything unclassified
142
+ $skinStatusTagOkColor: #5e7e63!default; // ok / published / complete / green / yes
143
+ $skinStatusTagNoticeColor: #3874d2!default; // notice / blue
144
+ $skinStatusTagWarnColor: #9e6c15!default; // warn / warning / orange
145
+ $skinStatusTagErrorColor: #ce483b!default; // error / errored / red
134
146
 
135
147
  //DARK-MODE PALETTE---------------------------------------------------------------------------------------------------//
136
148
  // Semantic CSS custom properties for runtime light/dark switching. Light values
@@ -221,9 +233,18 @@ html[data-theme="dark"] { @include aa-dark-palette; }
221
233
  html[data-theme="dark"] { @content; }
222
234
  }
223
235
 
224
- // Иконки переключателя тем. Инлайном, потому что гем не возит картинок, и
225
- // маской, а не цветным SVG: маска красится currentColor и сама идёт за
226
- // $skinMenuTextColor. Половинка круга — auto, солнце — light, месяц — dark.
236
+ // Sort markers. Three shapes rather than one at two opacities: ActiveAdmin's
237
+ // sprite draws a double arrow for sortable-but-unsorted, and reusing the
238
+ // descending triangle for it leaves the two states indistinguishable on a
239
+ // freshly loaded index. Masked, like the theme switch icons, so they take
240
+ // currentColor and follow the heading into dark mode.
241
+ $sort-icon-none: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 9 12'%3E%3Cpath d='M4.5 0 9 5H0z'/%3E%3Cpath d='M4.5 12 0 7h9z'/%3E%3C/svg%3E")!default;
242
+ $sort-icon-asc: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 9 12'%3E%3Cpath d='M4.5 2 9 8H0z'/%3E%3C/svg%3E")!default;
243
+ $sort-icon-desc: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 9 12'%3E%3Cpath d='M4.5 10 0 4h9z'/%3E%3C/svg%3E")!default;
244
+
245
+ // Theme switch icons. Inline, because the gem ships no image files, and as a
246
+ // mask rather than a coloured SVG: a mask takes currentColor and so follows
247
+ // $skinMenuTextColor on its own. Half circle = auto, sun = light, moon = dark.
227
248
  $theme-icon-auto: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='8' r='6.6' fill='none' stroke='black' stroke-width='1.4'/%3E%3Cpath d='M8 2.6a5.4 5.4 0 0 1 0 10.8z'/%3E%3C/svg%3E")!default;
228
249
  $theme-icon-light: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.4' stroke-linecap='round'%3E%3Ccircle cx='8' cy='8' r='3.1'/%3E%3Cpath d='M8 .9v1.8M8 13.3v1.8M.9 8h1.8M13.3 8h1.8M2.9 2.9l1.3 1.3M11.8 11.8l1.3 1.3M13.1 2.9l-1.3 1.3M4.2 11.8l-1.3 1.3'/%3E%3C/svg%3E")!default;
229
250
  $theme-icon-dark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M13.4 9.6A5.9 5.9 0 0 1 6.4 2.6a5.9 5.9 0 1 0 7 7z'/%3E%3C/svg%3E")!default;
@@ -301,7 +322,13 @@ $theme-icon-dark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/s
301
322
  skinInactiveTabTextColor: $skinInactiveTabTextColor,
302
323
  skinInactiveTabTextColorDark: $skinInactiveTabTextColorDark,
303
324
  skinTableHeaderTextColor: $skinTableHeaderTextColor,
304
- skinTableHeaderTextColorDark: $skinTableHeaderTextColorDark
325
+ skinTableHeaderTextColorDark: $skinTableHeaderTextColorDark,
326
+ skinStatusTagTextColor: $skinStatusTagTextColor,
327
+ skinStatusTagNeutralColor: $skinStatusTagNeutralColor,
328
+ skinStatusTagOkColor: $skinStatusTagOkColor,
329
+ skinStatusTagNoticeColor: $skinStatusTagNoticeColor,
330
+ skinStatusTagWarnColor: $skinStatusTagWarnColor,
331
+ skinStatusTagErrorColor: $skinStatusTagErrorColor
305
332
  ) {
306
333
  @if type-of($value) != color {
307
334
  @error "$#{$name} must be a color (use `transparent`, not `none`), got `#{$value}`.";
@@ -319,11 +346,11 @@ $theme-icon-dark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/s
319
346
  @error "$#{$name} must be a color or a CSS custom property (e.g. var(--aa-page-bg)), got `#{$value}`.";
320
347
  }
321
348
  }
322
- // Радиус внутреннего угла ячейки — на 1px меньше внешнего, чтобы не торчал
323
- // из-под рамки таблицы. Вычитать px напрямую нельзя: $skinBorderRadius задаёт
324
- // проект, и 0.25rem роняет всю компиляцию с «Incompatible units». calc()
325
- // откладывает вычитание до браузера, а безразмерный 0 обрабатываем отдельно —
326
- // calc(0 - 1px) невалиден.
349
+ // A cell's inner corner is 1px tighter than the outer one, so it does not
350
+ // show from under the table border. Subtracting px directly will not do: the
351
+ // radius is a project's to set, and 0.25rem fails the whole compile with
352
+ // "Incompatible units". calc() defers the subtraction to the browser, and a
353
+ // unitless 0 is handled separately because calc(0 - 1px) is invalid.
327
354
  @function inner-radius($radius) {
328
355
  @if unitless($radius) { @return 0; }
329
356
  @return calc(#{$radius} - 1px);
@@ -441,8 +468,10 @@ body.active_admin {
441
468
  // $skinMenuTextColor like every other item in the bar.
442
469
  // On the li, not only the anchor: font-size 0 collapses the anchor to the
443
470
  // icon's own 16px, which then sits at the top of the item instead of on
444
- // the line the rest of the bar shares.
445
- > li#theme_toggle { display: flex; align-items: center; }
471
+ // the line the rest of the bar shares. inline-flex, not flex: ActiveAdmin
472
+ // lays the utility nav out as `li { display: inline }`, and a block-level
473
+ // item breaks the row, dropping the items after it onto new lines.
474
+ > li#theme_toggle { display: inline-flex; align-items: center; vertical-align: middle; }
446
475
  > li#theme_toggle > a {
447
476
  display: flex;
448
477
  align-items: center;
@@ -874,6 +903,55 @@ body.active_admin {
874
903
  font-weight: bold!important;
875
904
  }
876
905
  }
906
+ // ActiveAdmin puts the sort arrow inside the heading link, on the left, as a
907
+ // background image cleared with `padding-left: 13px`. That indents the label
908
+ // of every sortable column by 13px while the data below starts at the cell's
909
+ // own padding, so a heading never lines up with its column. The link is also
910
+ // `display: block`, so moving the image to the right edge would park the
911
+ // arrow at the far side of the column instead of beside the text.
912
+ //
913
+ // Drawn as a pseudo-element instead: it follows the label immediately, the
914
+ // link keeps its full width so the whole cell stays clickable, and the
915
+ // marker takes currentColor — the stock sprite is a fixed grey PNG that
916
+ // cannot follow the text into dark mode.
917
+ // The sprite goes from every anchor in a sortable heading, because
918
+ // ActiveAdmin sets it on every one — an application link in there would
919
+ // otherwise keep the low-res PNG and the 13px indent it needs.
920
+ th.sortable a {
921
+ padding-left: 0;
922
+ background-image: none;
923
+ }
924
+ // The marker, though, only on ActiveAdmin's own heading link, which always
925
+ // carries the order parameter: an application's link is its own business.
926
+ th.sortable > a[href*="order="] {
927
+
928
+ &:after {
929
+ content: "";
930
+ display: inline-block;
931
+ width: 9px;
932
+ height: 12px;
933
+ margin-left: 6px;
934
+ vertical-align: middle;
935
+ background-color: currentColor;
936
+ -webkit-mask: #{$sort-icon-none} center / contain no-repeat;
937
+ mask: #{$sort-icon-none} center / contain no-repeat;
938
+ // 0.6, not lower: the marker is the only thing separating a sortable
939
+ // heading from a plain one, so WCAG 1.4.11 asks 3:1 of it. Against the
940
+ // header fill it gives 3.40 light and 4.22 dark; at 0.4 it was 2.13
941
+ // and 2.73.
942
+ opacity: 0.6;
943
+ }
944
+ }
945
+ th.sorted-asc > a[href*="order="]:after {
946
+ -webkit-mask-image: $sort-icon-asc;
947
+ mask-image: $sort-icon-asc;
948
+ opacity: 1;
949
+ }
950
+ th.sorted-desc > a[href*="order="]:after {
951
+ -webkit-mask-image: $sort-icon-desc;
952
+ mask-image: $sort-icon-desc;
953
+ opacity: 1;
954
+ }
877
955
  // Right edge = a single 1px line on the last-column cells (header th, body
878
956
  // td, footer cells) coloured like the table border, since the table itself
879
957
  // no longer draws a right border.
@@ -1413,11 +1491,9 @@ input[type='radio'] {
1413
1491
  @mixin status-tag-colors($c) {
1414
1492
  background: $c;
1415
1493
  border-color: mix($c, #000000, 84%); // = darken($c) — outline in the fill colour
1416
- // Black, not white: the five fills below are mid-tone, and white lands
1417
- // between 2.35 and 3.78 against them — under the 4.5 WCAG AA asks for text
1418
- // this small. Black gives at least 5.56 on every one of them. #1a1d21 was
1419
- // the first thing tried and misses by 0.02 on the error red.
1420
- color: #000000;
1494
+ // The fills are dark enough to carry this label: every one of the five is at
1495
+ // least 4.53 against white. Lighten one and the label needs to go with it.
1496
+ color: $skinStatusTagTextColor;
1421
1497
  }
1422
1498
 
1423
1499
  //CONTENT (both modes)-----------------------------------------------------------//
@@ -1449,11 +1525,11 @@ input[type='radio'] {
1449
1525
  border-radius: 2px;
1450
1526
  border: 1px solid;
1451
1527
 
1452
- @include status-tag-colors(#8a909a); // neutral default (e.g. "No", protocol tags)
1453
- &.ok, &.published, &.complete, &.completed, &.green, &.yes { @include status-tag-colors(#8daa92); }
1454
- &.notice, &.blue { @include status-tag-colors(#6090db); }
1455
- &.warn, &.warning, &.orange { @include status-tag-colors(#e29b20); }
1456
- &.error, &.errored, &.red { @include status-tag-colors(#d45f53); }
1528
+ @include status-tag-colors($skinStatusTagNeutralColor);
1529
+ &.ok, &.published, &.complete, &.completed, &.green, &.yes { @include status-tag-colors($skinStatusTagOkColor); }
1530
+ &.notice, &.blue { @include status-tag-colors($skinStatusTagNoticeColor); }
1531
+ &.warn, &.warning, &.orange { @include status-tag-colors($skinStatusTagWarnColor); }
1532
+ &.error, &.errored, &.red { @include status-tag-colors($skinStatusTagErrorColor); }
1457
1533
  &.empty, &.unknown, &.none {
1458
1534
  background: none;
1459
1535
  border: 0; // placeholder/empty tags stay unobtrusive (no outline)
@@ -1,3 +1,3 @@
1
1
  module ActiveAdminTheme
2
- VERSION = "3.0.0"
2
+ VERSION = "3.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_admin_theme
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0
4
+ version: 3.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Igor Fedoronchuk