Skip to content

Commit

Permalink
Scrollbar Gutter Color Fix
Browse files Browse the repository at this point in the history
Debugged this in Firefox and Chrome, my usage of setting the background color wasn't properly setting the custom property, and it was actually just setting the plain background itself, which wasn't accurate to what the component asks for.

I wish there was a way to strongly-type CSS declarations. That would be great.

I thought this was a specificity issue at first, for `num-text, .Editor`, but turns out I was just assigning to it incorrectly.

Also discovered during this that Firefox on macOS has bouncy scrolling at the edges of the textarea for NumText, but unline Safari, it doesn't report the scroll offsets to the scroll event handler, so there's no way to programmatically detect when you scroll up there. This is bad for NumText because of how I synchronize the syntax overlay and line numbers with the internal textarea element. This means I think there's less logic in doing it like that, and I may need to find a new way to sync the two up, either with a container that just renders them outright, or some other way. Unforuntate, but that's alright, it's kind of a niche thing to track anyways. The proper way to do it would be to have a fake scroll container anyways, because that would work exactly as the implementation using it does anyways, so you don't have to manually sync anything up yourself, you just have to worry about rendering them together, and letting the browser do the scrolling as it pleases.

Offroaders123/Num-Text#2
  • Loading branch information
Offroaders123 committed Nov 8, 2024
1 parent 1589c81 commit 792020a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ main .workspace .Editor {
position: absolute;
width: 100%;
height: 100%;
background: var(--workspace-background);
--background: var(--workspace-background);
border: solid transparent;
border-width: 0 var(--safe-area-inset-right) var(--safe-area-inset-bottom) var(--safe-area-inset-left);
visibility: hidden;
Expand Down

0 comments on commit 792020a

Please sign in to comment.