@andrewcyuan/focusgrid 0.2.0 → 0.2.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.
package/README.md CHANGED
@@ -43,4 +43,29 @@ Focusgrid can be easily customized. It can be the surface in which you create yo
43
43
  - To write your own frontend framework binding, use `getPane`, `getContainerSize`, and `getSplitSizes` for specific queries, and `subscribe` for changes.
44
44
 
45
45
 
46
+ **Styling**
47
+
48
+ The optional `@andrewcyuan/focusgrid/react/styles.css` stylesheet uses zero-specificity `:where(...)` selectors. Ordinary class selectors override its defaults regardless of stylesheet order, including active, hover, and focus-visible states; no extra parent selector or `!important` is needed.
49
+
50
+ Set these inherited variables on your grid or an ancestor to customize the default colors:
51
+
52
+ | Variable | Default | Applies to |
53
+ | --- | --- | --- |
54
+ | `--focusgrid-focus-color` | `#4d8dff` | Active pane outline |
55
+ | `--focusgrid-handle-idle-color` | `transparent` | Idle resize handle |
56
+ | `--focusgrid-handle-color` | `rgb(77 141 255 / 35%)` | Hovered or focus-visible resize handle |
57
+
58
+ ```css
59
+ .myGrid {
60
+ --focusgrid-handle-idle-color: #555;
61
+ --focusgrid-handle-color: #aaa;
62
+ }
63
+
64
+ .FocusgridPaneView { outline: none; }
65
+ .FocusgridResizeHandle { background: #555; }
66
+ .FocusgridResizeHandle:hover { background: #aaa; }
67
+ ```
68
+
69
+ Pane and handle positions and dimensions still come from inline styles computed by the layout controller; the zero-specificity defaults do not change that geometry.
70
+
46
71
  Made by [Andrew Yuan](https://andrewcyuan.com)
@@ -1,4 +1,4 @@
1
- .FocusgridFocusGrid {
1
+ :where(.FocusgridFocusGrid) {
2
2
  position: relative;
3
3
  width: 100%;
4
4
  height: 100%;
@@ -7,7 +7,7 @@
7
7
  outline: none;
8
8
  }
9
9
 
10
- .FocusgridPaneView {
10
+ :where(.FocusgridPaneView) {
11
11
  position: absolute;
12
12
  box-sizing: border-box;
13
13
  overflow: hidden;
@@ -15,28 +15,28 @@
15
15
  min-height: 0;
16
16
  }
17
17
 
18
- .FocusgridPaneView[data-active="true"] {
18
+ :where(.FocusgridPaneView[data-active="true"]) {
19
19
  outline: 1px solid var(--focusgrid-focus-color, #4d8dff);
20
20
  outline-offset: -1px;
21
21
  }
22
22
 
23
- .FocusgridResizeHandle {
23
+ :where(.FocusgridResizeHandle) {
24
24
  position: absolute;
25
25
  box-sizing: border-box;
26
26
  z-index: 2;
27
- background: transparent;
27
+ background: var(--focusgrid-handle-idle-color, transparent);
28
28
  touch-action: none;
29
29
  }
30
30
 
31
- .FocusgridResizeHandle[data-direction="horizontal"] {
31
+ :where(.FocusgridResizeHandle[data-direction="horizontal"]) {
32
32
  cursor: col-resize;
33
33
  }
34
34
 
35
- .FocusgridResizeHandle[data-direction="vertical"] {
35
+ :where(.FocusgridResizeHandle[data-direction="vertical"]) {
36
36
  cursor: row-resize;
37
37
  }
38
38
 
39
- .FocusgridResizeHandle:hover,
40
- .FocusgridResizeHandle:focus-visible {
39
+ :where(.FocusgridResizeHandle:hover),
40
+ :where(.FocusgridResizeHandle:focus-visible) {
41
41
  background: var(--focusgrid-handle-color, rgb(77 141 255 / 35%));
42
42
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@andrewcyuan/focusgrid",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "Keyboard-native pane layouts and deterministic focus management for web applications.",
5
5
  "keywords": [
6
6
  "keyboard-navigation",