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

fix: color single security scheme #1718

Merged
merged 1 commit into from
May 14, 2024
Merged

fix: color single security scheme #1718

merged 1 commit into from
May 14, 2024

Conversation

adjsky
Copy link
Contributor

@adjsky adjsky commented May 13, 2024

Problem
Currently, if securitySchemes is defined with a single scheme, uncolored security scheme will be displayed in the API client.

Before:
1(1)

After:
2(1)

Explanation
The issue is... the needed styles weren't applied to text if a single scheme is provided.

Solution
Put .security-scheme-selector span into a separate class, and use it for scheme labels.

@adjsky adjsky requested a review from marclave as a code owner May 13, 2024 16:09
Copy link

changeset-bot bot commented May 13, 2024

🦋 Changeset detected

Latest commit: 9c2147a

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

This PR includes changesets to release 13 packages
Name Type
@scalar/api-client Patch
@scalar/api-client-react Patch
@scalar/api-reference Patch
@scalar/play-button Patch
@scalar/api-reference-react Patch
@scalar/cli Patch
@scalar/express-api-reference Patch
@scalar/fastify-api-reference Patch
@scalar/hono-api-reference Patch
@scalar/nestjs-api-reference Patch
@scalar/nextjs-api-reference Patch
@scalar/nuxt Patch
@scalar/docusaurus 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

@adjsky adjsky force-pushed the main branch 2 times, most recently from 0512389 to 33ee9f0 Compare May 13, 2024 16:29
@adjsky
Copy link
Contributor Author

adjsky commented May 13, 2024

Oh... after opening PR I noticed that CollapsibleSection adds extra styles to any span inside options. Plans changed, so I abandoned the previous solution, and decided to put .security-scheme-selector span into a separate class, and use it for labels.

Copy link
Member

@marclave marclave left a comment

Choose a reason for hiding this comment

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

nice work @adjsky !!

@marclave marclave merged commit e022ee6 into scalar:main May 14, 2024
8 checks passed
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

2 participants