Repository navigation
Highlight the active line in the code editor #266
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,6 +23,7 @@ | |
| --code-gutter: #181816; | ||
| --code-caret: #f4f4f0; | ||
| --code-selection: #264f78; | ||
| --code-active-line: #ffffff0f; | ||
| /* Selected text needs its own color: --ink is a light page color that would | ||
| stay light on a light selection background in the light theme. */ | ||
| --code-selection-ink: var(--ink); | ||
|
|
@@ -611,7 +612,6 @@ p { | |
| cursor: default; | ||
| } | ||
|
|
||
|
|
||
| .progress-chart-point-missing { | ||
| fill: var(--page); | ||
| stroke: var(--muted); | ||
|
|
@@ -1239,7 +1239,8 @@ p { | |
| but never drops below 3.25rem, or a four-digit one is clipped at the | ||
| smallest. */ | ||
| --editor-font-size: 0.875rem; | ||
| --editor-font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; | ||
| --editor-font-family: | ||
| ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; | ||
| --editor-gutter: max(3.25rem, calc(var(--editor-font-size) * 3.72)); | ||
| position: relative; | ||
| flex: 1; | ||
|
|
@@ -1265,6 +1266,7 @@ p { | |
| --code-gutter-ink: #595959; | ||
| --code-gutter-border: #dddddd; | ||
| --code-guide: #d3d3d3; | ||
| --code-active-line: #0000000d; | ||
| --tok-keyword: #0000ff; | ||
| --tok-string: #a31515; | ||
| --tok-comment: #008000; | ||
|
|
@@ -1290,6 +1292,7 @@ p { | |
| --code-gutter-ink: #595959; | ||
| --code-gutter-border: #dddddd; | ||
| --code-guide: #d3d3d3; | ||
| --code-active-line: #0000000d; | ||
| --tok-keyword: #0000ff; | ||
| --tok-string: #a31515; | ||
| --tok-comment: #008000; | ||
|
|
@@ -1333,6 +1336,20 @@ p { | |
| box-shadow: inset 1px 0 0 var(--code-guide); | ||
| } | ||
|
|
||
| #editor-lines, | ||
| #editor-highlight, | ||
| .plain-text #editor { | ||
| background-image: linear-gradient( | ||
| var(--code-active-line), | ||
| var(--code-active-line) | ||
| ); | ||
| background-repeat: no-repeat; | ||
| background-size: 100% calc(var(--editor-font-size) * 1.5); | ||
| background-position: 0 | ||
| calc(1rem + var(--active-line, -100) * var(--editor-font-size) * 1.5); | ||
| background-attachment: local; | ||
| } | ||
|
|
||
| /* The user-agent stylesheet gives <code> its own monospace family, which | ||
| beats the inherited stack and paints the overlay in a different font from | ||
| the textarea, so the text drifts from the caret line by line. */ | ||
|
|
@@ -1348,7 +1365,7 @@ p { | |
| padding: 1rem 0.5rem; | ||
| overflow: hidden; | ||
| color: var(--code-gutter-ink); | ||
| background: var(--code-gutter); | ||
| background-color: var(--code-gutter); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The description says the gutter reads |
||
| border-right: 1px solid var(--code-gutter-border); | ||
| font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; | ||
| font-size: var(--editor-font-size); | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.