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(styling): Make the Swagger UI Operation page more responsive on smaller screen #9325

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions src/core/components/operation-summary.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,15 @@ export default class OperationSummary extends PureComponent {
onClick={toggleShown}
>
<OperationSummaryMethod method={method} />
<OperationSummaryPath getComponent={getComponent} operationProps={operationProps} specPath={specPath} />
<div className="opblock-summary-path-description-wrapper">
<OperationSummaryPath getComponent={getComponent} operationProps={operationProps} specPath={specPath} />

{!showSummary ? null :
<div className="opblock-summary-description">
{toString(resolvedSummary || summary)}
</div>
}
{!showSummary ? null :
<div className="opblock-summary-description">
{toString(resolvedSummary || summary)}
</div>
}
</div>

{displayOperationId && (originalOperationId || operationId) ? <span className="opblock-summary-operation-id">{originalOperationId || operationId}</span> : null}
</button>
Expand Down
57 changes: 50 additions & 7 deletions src/style/_layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,9 @@
{
font-size: 14px;
font-weight: bold;
@media (max-width: 768px) {
font-size: 12px;
}

min-width: 80px;
padding: 6px 0;
Expand Down Expand Up @@ -333,23 +336,20 @@

word-break: break-word;

padding: 0 10px;

@include text_code();

}

.opblock-summary-path
{
flex-shrink: 0;
max-width: calc(100% - 110px - 15rem);
}

@media (max-width: 640px) {
.opblock-summary-path
{
flex-shrink: 1;
max-width: 100%;
flex-shrink: 1;
max-width: 100%;
}
}

Expand All @@ -367,13 +367,31 @@
{
font-size: 13px;

flex: 1 1 auto;

word-break: break-word;

@include text_body();
}

.opblock-summary-path-description-wrapper
{
display: flex;
align-items: center;
flex-wrap: wrap;
gap: 0px 10px;

padding: 0 10px;

width: 100%;
}

@media (max-width: 550px) {
.opblock-summary-path-description-wrapper
{
flex-direction: column;
align-items: start;
}
}

.opblock-summary
{
display: flex;
Expand Down Expand Up @@ -772,6 +790,10 @@
{
display: flex;
align-items: flex-end;
justify-content: space-between;
flex-wrap: wrap;

gap: 10px;

> label
{
Expand All @@ -792,6 +814,27 @@
text-transform: uppercase;
}
}

/*
Target Authorize Button in schemes wrapper
This was added here to fix responsiveness issues with the authorize button
within the schemes wrapper without affecting other instances of it's usage
*/
.auth-wrapper
{
flex: none;
justify-content: none;

.authorize
{
padding-right: 20px;
margin: 0;

display: flex;

flex-wrap: nowrap;
}
}
}
}

Expand Down
17 changes: 17 additions & 0 deletions src/style/_topbar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,17 @@
{
display: flex;
align-items: center;
flex-wrap: wrap;
gap: 10px;
}
@media (max-width: 550px) {
.topbar-wrapper
{
flex-direction: column;
align-items: start;
}
}

a
{
font-size: 1.5em;
Expand Down Expand Up @@ -39,6 +49,7 @@
input[type=text]
{
width: 100%;
max-width: 100%;
margin: 0;

border: 2px solid $topbar-download-url-wrapper-element-border-color;
Expand Down Expand Up @@ -93,4 +104,10 @@
@include text_headline($topbar-download-url-button-font-color);
}
}
@media (max-width: 550px) {
.download-url-wrapper
{
width: 100%;
}
}
}