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

Add sidebar item classname for method #104

Merged

Conversation

bourdakos1
Copy link
Member

@bourdakos1 bourdakos1 commented Dec 18, 2021

This PR adds addition classnames to the api sidebar items to enable support for adding method tags via css magic (thanks @sserrata):

Screen Shot 2021-12-18 at 2 16 13 PM

CSS used to generate the above screenshot:

.api-method > .menu__link {
  align-items: center;
  justify-content: start;
}

.api-method > .menu__link::before {
  width: 50px;
  height: 20px;
  font-size: 12px;
  line-height: 20px;
  text-transform: uppercase;
  font-weight: 600;
  border-radius: .25rem;
  border: 1px solid;
  margin-right: var(--ifm-spacing-horizontal);
  text-align: center;
  flex-shrink: 0;
}

.get > .menu__link::before {
  content: "get";
  border-color: var(--openapi-code-blue);
  color:  var(--openapi-code-blue);
}

.put > .menu__link::before {
  content: "put";
  border-color: var(--openapi-code-orange);
  color: var(--openapi-code-orange);
}

.post > .menu__link::before {
  content: "post";
  border-color: var(--openapi-code-green);
  color: var(--openapi-code-green);
}

.delete > .menu__link::before {
  content: "del";
  border-color: var(--openapi-code-red);
  color: var(--openapi-code-red);
}

closes #101

@codesandbox-ci
Copy link

codesandbox-ci bot commented Dec 18, 2021

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit e177baf:

Sandbox Source
demo Configuration

@bourdakos1 bourdakos1 merged commit 843f8ea into cloud-annotations:main Dec 18, 2021
@bourdakos1 bourdakos1 deleted the method-classnames-sidebar branch December 18, 2021 20:02
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.

Feature request: Endpoints in menu should display method tags
1 participant