@fuzdev/fuz_code 0.46.1 → 0.46.2

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.
@@ -99,20 +99,29 @@
99
99
  width: 100%;
100
100
  }
101
101
 
102
- /* metrics shared by both layers so characters align exactly */
102
+ /* Metrics shared by both layers so characters align exactly. fuz_css styles
103
+ `pre` and `textarea` differently, so each declaration here equalizes them;
104
+ anything fuz_css already applies identically (box-sizing, the reset margin,
105
+ colors) is left to it. */
103
106
  .code_textarea_backdrop,
104
107
  .code_textarea textarea {
108
+ /* the backdrop `pre` isn't the last child, so fuz_css's flow rule would give
109
+ it a bottom margin that shrinks its absolute box and drifts the last line */
105
110
  margin: 0;
106
- box-sizing: border-box;
107
111
  width: 100%;
112
+ /* fuz_css pads the textarea but not `pre` — pin both the same */
108
113
  padding: var(--space_xs3) var(--space_xs);
114
+ /* fuz_css borders the textarea but not `pre`; a transparent border on both
115
+ keeps the box metrics identical (the textarea's is colored below) */
109
116
  border: 1px solid transparent;
110
117
  border-radius: var(--radius_xs, 2px);
111
- font-family: var(--font_family_mono, monospace);
112
- font-size: var(--font_size_sm, 0.9rem);
113
- line-height: var(--line_height_md, 1.5);
114
- letter-spacing: inherit;
118
+ /* the textarea would otherwise inherit the page's proportional font and
119
+ `line-height: normal`; the backdrop `pre` is already mono */
120
+ font-family: var(--font_family_mono);
121
+ font-size: var(--font_size_sm);
122
+ line-height: var(--line_height_md);
115
123
  tab-size: 2;
124
+ /* fuz_css sets `pre` to `white-space: pre`; both must wrap to stay aligned */
116
125
  white-space: pre-wrap;
117
126
  overflow-wrap: break-word;
118
127
  overflow: auto;
@@ -130,7 +139,6 @@
130
139
  pointer-events: none;
131
140
  user-select: none;
132
141
  overflow: hidden;
133
- color: var(--text_color, currentColor);
134
142
  }
135
143
 
136
144
  .code_textarea textarea {
@@ -138,12 +146,11 @@
138
146
  textarea is the only in-flow layer, so it sizes the container */
139
147
  position: relative;
140
148
  z-index: 1;
141
- display: block;
149
+ /* the textarea's own text is invisible; the backdrop (a styled `pre`) shows
150
+ through, so restore a visible caret and border over the transparent ones */
142
151
  background-color: transparent;
143
- /* the textarea's own text is invisible; the backdrop shows through */
144
152
  color: transparent;
145
- caret-color: var(--text_color, currentColor);
146
- border-color: var(--border_color, currentColor);
147
- resize: vertical;
153
+ caret-color: var(--text_color);
154
+ border-color: var(--border_color);
148
155
  }
149
156
  </style>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fuzdev/fuz_code",
3
- "version": "0.46.1",
3
+ "version": "0.46.2",
4
4
  "description": "syntax styling utilities and components for TypeScript, Svelte, Markdown, and more",
5
5
  "glyph": "🎨",
6
6
  "logo": "logo.svg",
@@ -56,7 +56,7 @@
56
56
  "@changesets/changelog-git": "^0.2.1",
57
57
  "@fuzdev/blake3_wasm": "^0.1.1",
58
58
  "@fuzdev/fuz_css": "^0.63.2",
59
- "@fuzdev/fuz_ui": "^0.205.0",
59
+ "@fuzdev/fuz_ui": "^0.205.1",
60
60
  "@fuzdev/fuz_util": "^0.65.1",
61
61
  "@fuzdev/gro": "^0.204.0",
62
62
  "@fuzdev/mdz": "^0.1.0",