Skip to content
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

feat: Add codemirror syntax highlighting back in and move to a static color #1080

Merged
merged 3 commits into from
Feb 29, 2024

Conversation

geoffgscott
Copy link
Contributor

For some reason the ::selection does not seem to accept our .dark-mode, .light-mode variables. For now we will hard code a color.

This also adds syntax highlighting back in.

Copy link

changeset-bot bot commented Feb 28, 2024

🦋 Changeset detected

Latest commit: de24d96

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 14 packages
Name Type
@scalar/fastify-api-reference Patch
@scalar/api-client-proxy Patch
@scalar/swagger-editor Patch
@scalar/swagger-parser Patch
@scalar/use-codemirror Patch
@scalar/api-reference Patch
@scalar/echo-server Patch
@scalar/api-client Patch
@scalar/components Patch
@scalar/express-api-reference Patch
@scalar/hono-api-reference Patch
@scalar/nestjs-api-reference Patch
@scalar/nextjs-api-reference Patch
@scalar/api-client-react Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@amritk
Copy link
Member

amritk commented Feb 28, 2024

should we just move to prism?

Copy link

relativeci bot commented Feb 28, 2024

Job #375: Bundle Size — 2.06MiB (+2.2%).

a1a8ba5(current) vs 1f2921f main#373(baseline)

Warning

Bundle contains 5 duplicate packages – View duplicate packages

Warning

Bundle introduced 2 new packages: @lezer/yaml, @codemirror/lang-yaml – View changed packages

Bundle metrics  Change 4 changes Regression 2 regressions
                 Current
Job #375
     Baseline
Job #373
Regression  Initial JS 2.06MiB(+2.2%) 2.02MiB
No change  Initial CSS 0B 0B
Change  Cache Invalidation 100% 0%
No change  Chunks 1 1
No change  Assets 1 1
Change  Modules 1391(+0.07%) 1390
No change  Duplicate Modules 0 0
No change  Duplicate Code 0% 0%
Regression  Packages 206(+0.49%) 205
No change  Duplicate Packages 5 5
Bundle size by type  Change 1 change Regression 1 regression
                 Current
Job #375
     Baseline
Job #373
Regression  JS 2.06MiB (+2.2%) 2.02MiB

View job #375 reportView geoff/doc-1464-highlighting-in-r... branch activityView project dashboard

@marclave
Copy link
Member

should we just move to prism?

im down for this! I still say let's merge this since it fixes a bunch of bugs and we can do follow up work to remove the couple of lang highlighting we have : )

@amritk
Copy link
Member

amritk commented Feb 28, 2024

wtb preview app

@hanspagel this PR has the same bundle issue

@hanspagel hanspagel force-pushed the geoff/doc-1464-highlighting-in-references branch from ae76474 to a3b2e0a Compare February 29, 2024 08:41
Copy link
Contributor

Copy link
Member

@hanspagel hanspagel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome PR! I’ve added some minor details that came to mind when reviewing.

Anyway, I’m too stupid to see what the added CodeMirror plugins do. If you could enlighten me, that would be great.

But let’s get this in!

@hanspagel
Copy link
Member

Ah, and I just saw @marclave had another fix for the selection color here:

'.cm-selectionBackground, ::selection': {
backgroundColor:
'var(--theme-background-3, var(--default-theme-background-3))',
},

Should we add this to the PR here instead of hard coding the color? 🤔

@marclave
Copy link
Member

marclave commented Feb 29, 2024

Ah, and I just saw @marclave had another fix for the selection color here:

'.cm-selectionBackground, ::selection': {
backgroundColor:
'var(--theme-background-3, var(--default-theme-background-3))',
},

Should we add this to the PR here instead of hard coding the color? 🤔

woah i had no idea this was in main! we noticed css variables dont work in selection selectors

edit does this happen for you?

@geoffgscott geoffgscott force-pushed the geoff/doc-1464-highlighting-in-references branch from a021325 to a1a8ba5 Compare February 29, 2024 20:21
@geoffgscott
Copy link
Contributor Author

Ah, and I just saw @marclave had another fix for the selection color here:

'.cm-selectionBackground, ::selection': {
backgroundColor:
'var(--theme-background-3, var(--default-theme-background-3))',
},

Should we add this to the PR here instead of hard coding the color? 🤔

This approach does not work. I think just stale code in Marcs branch

@geoffgscott geoffgscott merged commit 5bc2ebf into main Feb 29, 2024
7 of 9 checks passed
@geoffgscott geoffgscott deleted the geoff/doc-1464-highlighting-in-references branch February 29, 2024 20:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants