@inkbar/theme 0.6.0 → 0.7.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/theme.css +111 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inkbar/theme",
3
- "version": "0.6.0",
3
+ "version": "0.7.0",
4
4
  "description": "Default stylesheet for Inkbar. Zero specificity, so your CSS wins.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://inkbar.dev",
package/theme.css CHANGED
@@ -29,6 +29,9 @@
29
29
  --ink-ink: #151820;
30
30
  --ink-redact: #c0392b;
31
31
  --ink-redact-fill: #000000;
32
+ /* Pages stay white in dark mode and the search layer multiplies, so these serve both. */
33
+ --ink-search-hit: #f1ffa0;
34
+ --ink-search-current: #e4ff4a;
32
35
 
33
36
  --ink-bg: var(--muted, #f1f2f5);
34
37
  --ink-fg: var(--foreground, #151820);
@@ -318,6 +321,23 @@
318
321
  border-radius: 50%;
319
322
  }
320
323
 
324
+ /* Search matches sit under the annotations: before the overlay in the page, same level. The
325
+ layer multiplies with the page, so dark text shows through as if the page were marked. */
326
+ :where(.ink-search-layer) {
327
+ z-index: 1;
328
+ pointer-events: none;
329
+ mix-blend-mode: multiply;
330
+ }
331
+
332
+ :where([data-search-hit]) {
333
+ background: var(--ink-search-hit);
334
+ border-radius: 2px;
335
+ }
336
+
337
+ :where([data-search-hit][data-current]) {
338
+ background: var(--ink-search-current);
339
+ }
340
+
321
341
  /* Annotations */
322
342
  :where(.ink-overlay) {
323
343
  z-index: 1;
@@ -648,6 +668,97 @@
648
668
  font-size: 0.875rem;
649
669
  }
650
670
 
671
+ /*
672
+ * The find bar (createFindBar): floats over the top-right of the viewport root, which is
673
+ * what it positions against, so the pages do not move. Hidden while the search is closed.
674
+ */
675
+ :where(.ink-find-bar) {
676
+ position: absolute;
677
+ top: 0.5rem;
678
+ right: 1.5rem;
679
+ z-index: 3;
680
+ box-sizing: border-box;
681
+ max-width: calc(100% - 2rem);
682
+ display: flex;
683
+ align-items: center;
684
+ gap: 0.25rem;
685
+ padding: 0.25rem;
686
+ border: 1px solid var(--ink-border);
687
+ border-radius: var(--ink-radius);
688
+ background: var(--ink-surface);
689
+ color: var(--ink-fg);
690
+ box-shadow: 0 4px 16px rgb(0 0 0 / 0.18);
691
+ }
692
+
693
+ :where(.ink-find-bar[hidden]) {
694
+ display: none;
695
+ }
696
+
697
+ :where(.ink-find-bar input) {
698
+ box-sizing: border-box;
699
+ flex: 1;
700
+ width: 14rem;
701
+ min-width: 0;
702
+ height: var(--ink-control-size, 2.25rem);
703
+ padding: 0 0.5rem;
704
+ border: 1px solid var(--ink-border);
705
+ border-radius: calc(var(--ink-radius) - 2px);
706
+ background: var(--ink-surface);
707
+ color: inherit;
708
+ font: inherit;
709
+ }
710
+
711
+ :where(.ink-find-count) {
712
+ min-width: 4.5rem;
713
+ padding: 0 0.25rem;
714
+ color: var(--ink-muted-fg);
715
+ font-size: 0.875rem;
716
+ font-variant-numeric: tabular-nums;
717
+ white-space: nowrap;
718
+ }
719
+
720
+ :where(.ink-find-bar button) {
721
+ display: inline-flex;
722
+ align-items: center;
723
+ justify-content: center;
724
+ min-width: var(--ink-control-size, 2.25rem);
725
+ height: var(--ink-control-size, 2.25rem);
726
+ padding: 0 0.5rem;
727
+ border: 1px solid transparent;
728
+ border-radius: calc(var(--ink-radius) - 2px);
729
+ background: transparent;
730
+ color: inherit;
731
+ font: inherit;
732
+ cursor: pointer;
733
+ }
734
+
735
+ :where(.ink-find-bar button:hover) {
736
+ background: color-mix(in srgb, var(--ink-fg) 8%, transparent);
737
+ }
738
+
739
+ :where(.ink-find-bar button[aria-pressed='true']) {
740
+ background: var(--ink-accent);
741
+ color: var(--ink-accent-fg);
742
+ }
743
+
744
+ :where(.ink-find-bar input:focus-visible, .ink-find-bar button:focus-visible) {
745
+ outline: 2px solid var(--ink-ring);
746
+ outline-offset: 2px;
747
+ }
748
+
749
+ /* Text for assistive technology only, such as the find bar's live region. */
750
+ :where(.ink-visually-hidden) {
751
+ position: absolute;
752
+ width: 1px;
753
+ height: 1px;
754
+ margin: -1px;
755
+ padding: 0;
756
+ overflow: hidden;
757
+ clip-path: inset(50%);
758
+ white-space: nowrap;
759
+ border: 0;
760
+ }
761
+
651
762
  :where(.ink-toolbar input) {
652
763
  box-sizing: border-box;
653
764
  height: var(--ink-control-size, 2.25rem);