Watch
1
0
Fork
You've already forked Seyyed_arc
0
forked from hesabix/arc
Seyyed_arc/hesabixAPI/assets/swagger/custom.css
2026-05-05 05:00:17 +03:30

718 lines
16 KiB
CSS
Executable file

/*
* Hesabix API - Swagger UI Custom Styles
* نسخه: 1.0.0
* توضیحات: استایل‌های سفارشی برای بهبود ظاهر و خوانایی Swagger UI
*/
/* ==================== فونت‌های فارسی ==================== */
/* بدون بارگذاری از CDN؛ اگر وزیرمتن روی سیستم نصب باشد با local() استفاده می‌شود. */
/* ==================== تنظیمات پایه ==================== */
:root {
--hesabix-primary: #366092;
--hesabix-primary-dark: #2a4a6f;
--hesabix-primary-light: #4a7ab8;
--hesabix-secondary: #6c757d;
--hesabix-success: #28a745;
--hesabix-danger: #dc3545;
--hesabix-warning: #ffc107;
--hesabix-info: #17a2b8;
--hesabix-border: #dee2e6;
--hesabix-text: #212529;
--hesabix-muted: #6c757d;
--hesabix-background: #ffffff;
--hesabix-light-bg: #f8f9fa;
--hesabix-code-bg: #f5f7fa;
--hesabix-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
--hesabix-shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.15);
}
/* فونت اصلی برای کل رابط */
.swagger-ui,
.swagger-ui * {
font-family: 'Vazirmatn', 'YekanBakh', Tahoma, Arial, sans-serif !important;
}
/* فونت مناسب برای کدها و JSON */
.swagger-ui .model-box,
.swagger-ui .response-col_description__inner code,
.swagger-ui pre,
.swagger-ui code,
.swagger-ui .microlight {
font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', Consolas, monospace !important;
}
/* ==================== Topbar (هدر اصلی) ==================== */
.swagger-ui .topbar {
background-color: var(--hesabix-primary);
background: linear-gradient(135deg, var(--hesabix-primary) 0%, var(--hesabix-primary-dark) 100%);
padding: 15px 0;
box-shadow: var(--hesabix-shadow-lg);
}
.swagger-ui .topbar .wrapper {
display: flex;
align-items: center;
justify-content: space-between;
}
/* لوگو در هدر */
.swagger-ui .topbar .topbar-wrapper::before {
content: '';
background-image: url('/assets/logo-blue.png');
background-size: contain;
background-repeat: no-repeat;
filter: brightness(0) invert(1);
width: 150px;
height: 40px;
display: inline-block;
margin-left: 20px;
vertical-align: middle;
}
/* عنوان در Topbar */
.swagger-ui .topbar .link {
font-size: 1.5rem;
font-weight: 700;
color: #ffffff !important;
}
/* ==================== بخش اطلاعات (Info Section) ==================== */
.swagger-ui .info {
margin: 40px 0;
}
.swagger-ui .info .title {
font-size: 2.5rem;
font-weight: 700;
color: var(--hesabix-primary);
margin-bottom: 20px;
}
.swagger-ui .info .title small {
background-color: var(--hesabix-primary-light);
color: #ffffff;
padding: 5px 15px;
border-radius: 20px;
font-size: 0.8rem;
margin-right: 15px;
font-weight: 600;
}
.swagger-ui .info hgroup.main a {
color: var(--hesabix-primary);
text-decoration: none;
transition: color 0.3s ease;
}
.swagger-ui .info hgroup.main a:hover {
color: var(--hesabix-primary-dark);
}
/* ==================== دکمه‌ها ==================== */
.swagger-ui .btn {
border-radius: 8px;
font-weight: 600;
padding: 10px 20px;
transition: all 0.3s ease;
border: none;
cursor: pointer;
box-shadow: var(--hesabix-shadow);
}
.swagger-ui .btn:hover {
transform: translateY(-2px);
box-shadow: var(--hesabix-shadow-lg);
}
/* دکمه Authorize */
.swagger-ui .btn.authorize {
background-color: var(--hesabix-primary);
color: #ffffff;
border-color: var(--hesabix-primary);
}
.swagger-ui .btn.authorize:hover {
background-color: var(--hesabix-primary-dark);
border-color: var(--hesabix-primary-dark);
}
.swagger-ui .btn.authorize svg {
fill: #ffffff;
}
/* دکمه Execute */
.swagger-ui .btn.execute {
background-color: var(--hesabix-primary);
color: #ffffff;
border-color: var(--hesabix-primary);
}
.swagger-ui .btn.execute:hover {
background-color: var(--hesabix-primary-dark);
border-color: var(--hesabix-primary-dark);
}
/* دکمه Cancel */
.swagger-ui .btn.cancel {
background-color: var(--hesabix-secondary);
color: #ffffff;
}
.swagger-ui .btn.cancel:hover {
background-color: #5a6268;
}
/* ==================== لینک‌ها ==================== */
.swagger-ui a {
color: var(--hesabix-primary);
text-decoration: none;
transition: color 0.3s ease;
}
.swagger-ui a:hover {
color: var(--hesabix-primary-dark);
text-decoration: underline;
}
/* ==================== Tags (دسته‌بندی‌ها) ==================== */
.swagger-ui .opblock-tag {
font-size: 1.5rem;
font-weight: 700;
border-bottom: 3px solid var(--hesabix-primary);
padding-bottom: 10px;
margin: 30px 0 20px 0;
color: var(--hesabix-text);
cursor: pointer;
transition: all 0.3s ease;
}
.swagger-ui .opblock-tag:hover {
color: var(--hesabix-primary);
border-bottom-color: var(--hesabix-primary-dark);
}
.swagger-ui .opblock-tag-section {
margin-bottom: 30px;
}
/* آیکون کنار Tags */
.swagger-ui .opblock-tag .opblock-tag-section-title::before {
content: '📁 ';
margin-left: 10px;
font-size: 1.2rem;
}
/* ==================== Operation Blocks (متدهای API) ==================== */
.swagger-ui .opblock {
border-radius: 8px;
margin-bottom: 15px;
border: 2px solid;
box-shadow: var(--hesabix-shadow);
transition: all 0.3s ease;
}
.swagger-ui .opblock:hover {
box-shadow: var(--hesabix-shadow-lg);
transform: translateY(-2px);
}
/* متد GET */
.swagger-ui .opblock.opblock-get {
border-color: var(--hesabix-primary);
background: rgba(54, 96, 146, 0.05);
}
.swagger-ui .opblock.opblock-get .opblock-summary-method {
background-color: var(--hesabix-primary);
}
.swagger-ui .opblock.opblock-get .tab-header .tab-item.active h4 span::after {
background: var(--hesabix-primary);
}
/* متد POST */
.swagger-ui .opblock.opblock-post {
border-color: var(--hesabix-success);
background: rgba(40, 167, 69, 0.05);
}
.swagger-ui .opblock.opblock-post .opblock-summary-method {
background-color: var(--hesabix-success);
}
.swagger-ui .opblock.opblock-post .tab-header .tab-item.active h4 span::after {
background: var(--hesabix-success);
}
/* متد PUT */
.swagger-ui .opblock.opblock-put {
border-color: var(--hesabix-warning);
background: rgba(255, 193, 7, 0.05);
}
.swagger-ui .opblock.opblock-put .opblock-summary-method {
background-color: var(--hesabix-warning);
}
/* متد DELETE */
.swagger-ui .opblock.opblock-delete {
border-color: var(--hesabix-danger);
background: rgba(220, 53, 69, 0.05);
}
.swagger-ui .opblock.opblock-delete .opblock-summary-method {
background-color: var(--hesabix-danger);
}
/* متد PATCH */
.swagger-ui .opblock.opblock-patch {
border-color: var(--hesabix-info);
background: rgba(23, 162, 184, 0.05);
}
.swagger-ui .opblock.opblock-patch .opblock-summary-method {
background-color: var(--hesabix-info);
}
/* ==================== خلاصه Operation ==================== */
.swagger-ui .opblock-summary {
padding: 15px;
border-radius: 8px;
}
.swagger-ui .opblock-summary-method {
font-weight: 700;
border-radius: 6px;
padding: 8px 15px;
min-width: 80px;
text-align: center;
}
.swagger-ui .opblock-summary-path {
font-weight: 600;
font-size: 1rem;
}
.swagger-ui .opblock-summary-description {
font-size: 0.95rem;
color: var(--hesabix-muted);
}
/* ==================== Input Fields & Forms ==================== */
.swagger-ui input[type="text"],
.swagger-ui input[type="password"],
.swagger-ui input[type="email"],
.swagger-ui select,
.swagger-ui textarea {
border-radius: 6px;
border: 1px solid var(--hesabix-border);
padding: 10px;
font-size: 0.95rem;
transition: all 0.3s ease;
}
.swagger-ui input[type="text"]:focus,
.swagger-ui input[type="password"]:focus,
.swagger-ui input[type="email"]:focus,
.swagger-ui select:focus,
.swagger-ui textarea:focus {
border-color: var(--hesabix-primary);
box-shadow: 0 0 0 0.2rem rgba(54, 96, 146, 0.25);
outline: none;
}
/* ==================== کدها و مثال‌ها ==================== */
.swagger-ui code {
background-color: var(--hesabix-code-bg);
color: var(--hesabix-primary);
padding: 3px 8px;
border-radius: 4px;
font-size: 0.9em;
font-weight: 600;
}
.swagger-ui pre {
background-color: #2d3748;
color: #e2e8f0;
border-radius: 8px;
padding: 20px;
overflow-x: auto;
box-shadow: var(--hesabix-shadow);
}
.swagger-ui .model-example,
.swagger-ui .highlight-code {
background-color: var(--hesabix-light-bg);
border: 1px solid var(--hesabix-border);
border-radius: 8px;
padding: 15px;
margin: 10px 0;
}
/* ==================== Models (Schema) ==================== */
.swagger-ui .model {
font-size: 0.95rem;
}
.swagger-ui .model-box {
background-color: var(--hesabix-light-bg);
border-radius: 8px;
padding: 15px;
border: 1px solid var(--hesabix-border);
}
.swagger-ui .model-title {
font-size: 1.1rem;
font-weight: 700;
color: var(--hesabix-primary);
}
.swagger-ui .property-row {
padding: 8px 0;
border-bottom: 1px solid var(--hesabix-border);
}
.swagger-ui .property-row:last-child {
border-bottom: none;
}
/* ==================== Responses ==================== */
.swagger-ui .responses-wrapper {
margin-top: 20px;
}
.swagger-ui .response {
margin-bottom: 15px;
}
.swagger-ui .response-col_status {
font-weight: 700;
font-size: 1rem;
}
.swagger-ui .response-col_description {
font-size: 0.95rem;
}
.swagger-ui .response .response-col_status {
border-radius: 6px;
padding: 5px 10px;
}
/* کد موفقیت */
.swagger-ui .response.response-200 .response-col_status,
.swagger-ui .response.response-201 .response-col_status {
background-color: var(--hesabix-success);
color: #ffffff;
}
/* کد خطا */
.swagger-ui .response.response-400 .response-col_status,
.swagger-ui .response.response-401 .response-col_status,
.swagger-ui .response.response-403 .response-col_status,
.swagger-ui .response.response-404 .response-col_status,
.swagger-ui .response.response-500 .response-col_status {
background-color: var(--hesabix-danger);
color: #ffffff;
}
/* ==================== خوانایی و فاصله‌گذاری ==================== */
.swagger-ui .markdown p,
.swagger-ui .opblock-description-wrapper p,
.swagger-ui .info .description p {
line-height: 2;
margin-bottom: 1rem;
color: var(--hesabix-text);
}
.swagger-ui .markdown h1,
.swagger-ui .markdown h2,
.swagger-ui .markdown h3,
.swagger-ui .markdown h4,
.swagger-ui .markdown h5 {
color: var(--hesabix-primary);
font-weight: 700;
margin-top: 1.5rem;
margin-bottom: 1rem;
}
.swagger-ui .markdown ul,
.swagger-ui .markdown ol {
padding-right: 2rem;
padding-left: 0;
margin-bottom: 1rem;
}
.swagger-ui .markdown li {
margin-bottom: 0.5rem;
line-height: 1.8;
}
/* جداکنندهٔ بخش‌ها در توضیحات بالای Swagger (--- در مارک‌داون) */
.swagger-ui .info .description hr,
.swagger-ui .markdown hr {
border: 0;
border-top: 1px solid var(--hesabix-border);
margin: 1.75rem 0;
opacity: 0.9;
}
/* کمی فشرده‌تر کردن تیترهای سطح دو در بلوک intro برای سلسله‌مراتب واضح‌تر */
.swagger-ui .info .description h2,
.swagger-ui .info .markdown h2 {
font-size: 1.35rem;
padding-bottom: 0.35rem;
border-bottom: 2px solid rgba(54, 96, 146, 0.2);
}
/* ==================== Tables ==================== */
.swagger-ui table {
border-collapse: collapse;
width: 100%;
margin: 15px 0;
border-radius: 8px;
overflow: hidden;
box-shadow: var(--hesabix-shadow);
}
.swagger-ui table thead tr {
background-color: var(--hesabix-primary);
color: #ffffff;
font-weight: 700;
}
.swagger-ui table th,
.swagger-ui table td {
padding: 12px 15px;
border: 1px solid var(--hesabix-border);
}
.swagger-ui table tbody tr:nth-child(even) {
background-color: var(--hesabix-light-bg);
}
.swagger-ui table tbody tr:hover {
background-color: rgba(54, 96, 146, 0.1);
}
/* ==================== Authorization Modal ==================== */
.swagger-ui .dialog-ux {
border-radius: 12px;
box-shadow: var(--hesabix-shadow-lg);
}
.swagger-ui .dialog-ux .modal-ux {
border-radius: 12px;
overflow: hidden;
}
.swagger-ui .dialog-ux .modal-ux-header {
background-color: var(--hesabix-primary);
color: #ffffff;
padding: 20px;
border-bottom: none;
}
.swagger-ui .dialog-ux .modal-ux-header h3 {
color: #ffffff;
font-weight: 700;
font-size: 1.3rem;
}
/* ==================== Filter (جستجو) ==================== */
.swagger-ui .filter-container {
margin-bottom: 20px;
}
.swagger-ui .filter .operation-filter-input {
border: 2px solid var(--hesabix-border);
border-radius: 8px;
padding: 12px 15px;
font-size: 1rem;
width: 100%;
transition: all 0.3s ease;
}
.swagger-ui .filter .operation-filter-input:focus {
border-color: var(--hesabix-primary);
box-shadow: 0 0 0 0.2rem rgba(54, 96, 146, 0.25);
outline: none;
}
/* ==================== Loading & Spinners ==================== */
.swagger-ui .loading-container .loading {
border: 3px solid var(--hesabix-light-bg);
border-top: 3px solid var(--hesabix-primary);
}
/* ==================== Scrollbar سفارشی ==================== */
.swagger-ui ::-webkit-scrollbar {
width: 10px;
height: 10px;
}
.swagger-ui ::-webkit-scrollbar-track {
background: var(--hesabix-light-bg);
border-radius: 5px;
}
.swagger-ui ::-webkit-scrollbar-thumb {
background: var(--hesabix-primary);
border-radius: 5px;
}
.swagger-ui ::-webkit-scrollbar-thumb:hover {
background: var(--hesabix-primary-dark);
}
/* ==================== Errors & Warnings ==================== */
.swagger-ui .errors-wrapper {
background-color: rgba(220, 53, 69, 0.1);
border: 1px solid var(--hesabix-danger);
border-radius: 8px;
padding: 15px;
margin: 10px 0;
}
.swagger-ui .errors-wrapper .error-wrapper {
margin-bottom: 10px;
}
.swagger-ui .errors-wrapper h4 {
color: var(--hesabix-danger);
font-weight: 700;
}
/* ==================== Information Panel ==================== */
.swagger-ui .information-container {
background-color: var(--hesabix-light-bg);
border: 1px solid var(--hesabix-border);
border-radius: 8px;
padding: 20px;
margin: 20px 0;
}
/* ==================== Schemes (HTTP/HTTPS) ==================== */
.swagger-ui .schemes {
margin: 20px 0;
}
.swagger-ui .schemes .schemes-title {
font-weight: 700;
color: var(--hesabix-text);
}
.swagger-ui .schemes select {
border: 2px solid var(--hesabix-border);
border-radius: 6px;
padding: 8px 12px;
}
/* ==================== Responsive Design ==================== */
@media (max-width: 768px) {
.swagger-ui .topbar-wrapper::before {
width: 100px;
height: 30px;
}
.swagger-ui .info .title {
font-size: 1.8rem;
}
.swagger-ui .opblock-tag {
font-size: 1.2rem;
}
.swagger-ui .btn {
width: 100%;
margin-bottom: 10px;
}
.swagger-ui .opblock-summary-path {
font-size: 0.85rem;
}
}
@media (max-width: 480px) {
.swagger-ui .info .title {
font-size: 1.5rem;
}
.swagger-ui .topbar-wrapper::before {
width: 80px;
height: 25px;
}
}
/* ==================== Print Styles ==================== */
@media print {
.swagger-ui .topbar,
.swagger-ui .btn,
.swagger-ui .try-out,
.swagger-ui .filter-container {
display: none !important;
}
.swagger-ui .opblock {
page-break-inside: avoid;
}
}
/* ==================== انیمیشن‌ها ==================== */
@keyframes fadeIn {
from {
opacity: 0;
transform: translateY(-10px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
.swagger-ui .opblock {
animation: fadeIn 0.3s ease;
}
/* ==================== تنظیمات دسترسی‌پذیری ==================== */
.swagger-ui .btn:focus,
.swagger-ui input:focus,
.swagger-ui select:focus,
.swagger-ui textarea:focus,
.swagger-ui button:focus {
outline: 3px solid var(--hesabix-primary);
outline-offset: 2px;
}
/* ==================== Badge & Pills ==================== */
.swagger-ui .opblock-tag small {
background-color: var(--hesabix-primary);
color: #ffffff;
padding: 3px 10px;
border-radius: 12px;
font-size: 0.75rem;
margin-right: 10px;
font-weight: 600;
}
/* ==================== نمایش زمان پاسخ ==================== */
.swagger-ui .response .response-col_links {
font-size: 0.85rem;
color: var(--hesabix-muted);
}
/* ==================== Download Button ==================== */
.swagger-ui .download-contents {
background-color: var(--hesabix-primary);
color: #ffffff;
border-radius: 6px;
padding: 8px 15px;
font-weight: 600;
}
.swagger-ui .download-contents:hover {
background-color: var(--hesabix-primary-dark);
}