mirror of
https://github.com/documenso/documenso.git
synced 2025-11-13 00:03:33 +10:00
chore: updated styling
Signed-off-by: Adithya Krishna <aadithya794@gmail.com>
This commit is contained in:
@ -1,9 +0,0 @@
|
|||||||
/* Custom CSS for dark mode */
|
|
||||||
@media (prefers-color-scheme: dark) {
|
|
||||||
.swagger-ui {
|
|
||||||
filter: invert(85%) hue-rotate(180deg);
|
|
||||||
}
|
|
||||||
.swagger-ui .microlight {
|
|
||||||
filter: invert(100%) hue-rotate(180deg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,15 +1,30 @@
|
|||||||
'use client';
|
'use client';
|
||||||
|
|
||||||
|
import { useEffect } from 'react';
|
||||||
|
|
||||||
|
import { useTheme } from 'next-themes';
|
||||||
import SwaggerUI from 'swagger-ui-react';
|
import SwaggerUI from 'swagger-ui-react';
|
||||||
import 'swagger-ui-react/swagger-ui.css';
|
import 'swagger-ui-react/swagger-ui.css';
|
||||||
|
|
||||||
import { OpenAPIV1 } from '@documenso/api/v1/openapi';
|
import { OpenAPIV1 } from '@documenso/api/v1/openapi';
|
||||||
|
|
||||||
// Custom Dark Mode CSS for the Swagger UI
|
|
||||||
// eslint-disable-next-line prettier/prettier
|
|
||||||
import './api-documentation.css';
|
|
||||||
|
|
||||||
export const OpenApiDocsPage = () => {
|
export const OpenApiDocsPage = () => {
|
||||||
|
const { theme } = useTheme();
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
const body = document.body;
|
||||||
|
|
||||||
|
if (theme === 'dark') {
|
||||||
|
body.classList.add('swagger-dark-theme');
|
||||||
|
} else {
|
||||||
|
body.classList.remove('swagger-dark-theme');
|
||||||
|
}
|
||||||
|
|
||||||
|
return () => {
|
||||||
|
body.classList.remove('swagger-dark-theme');
|
||||||
|
};
|
||||||
|
}, [theme]);
|
||||||
|
|
||||||
return <SwaggerUI spec={OpenAPIV1} displayOperationId={true} />;
|
return <SwaggerUI spec={OpenAPIV1} displayOperationId={true} />;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -129,3 +129,12 @@
|
|||||||
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
|
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
|
||||||
background: rgb(100 116 139 / 0.5);
|
background: rgb(100 116 139 / 0.5);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Custom Swagger Dark Theme */
|
||||||
|
.swagger-dark-theme .swagger-ui {
|
||||||
|
filter: invert(88%) hue-rotate(180deg);
|
||||||
|
}
|
||||||
|
|
||||||
|
.swagger-dark-theme .swagger-ui .microlight {
|
||||||
|
filter: invert(100%) hue-rotate(180deg);
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user