webtest/styles/markdown.scss
2025-08-08 12:32:50 +02:00

721 lines
15 KiB
SCSS

/* Markdown Editor Styles */
.markdown-editor-container {
border: 1px solid var(--bs-border-color);
border-radius: 0.5rem;
overflow: hidden;
background: var(--bs-body-bg);
box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
height: 500px; /* Increased height for better modal experience */
min-height: 400px; /* Minimum height to ensure usability */
/* In modal context, take more space */
.modal-body & {
height: 60vh; /* Use viewport height for better responsiveness */
min-height: 450px;
max-height: 70vh; /* Prevent it from being too tall */
}
&.widescreen {
position: fixed;
top: 30px;
left: 30px;
right: 30px;
bottom: 30px;
z-index: 1050;
border: 2px solid var(--bs-primary);
box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.3);
border-radius: 0.75rem;
height: auto;
}
}
.markdown-toolbar {
display: flex;
justify-content: space-between;
align-items: center;
padding: 0.75rem 1rem;
background: linear-gradient(135deg, var(--bs-light) 0%, rgba(var(--bs-primary-rgb), 0.05) 100%);
border-bottom: 1px solid var(--bs-border-color);
.toolbar-left {
display: flex;
align-items: center;
gap: 0.75rem;
.btn {
border-radius: 0.375rem;
font-weight: 500;
padding: 0.375rem 0.75rem;
transition: all 0.2s ease;
&:hover {
transform: translateY(-1px);
box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
}
}
}
.toolbar-right {
display: flex;
align-items: center;
small {
font-weight: 500;
opacity: 0.8;
}
}
}
.markdown-editor {
display: flex;
height: calc(100% - 60px); /* Subtract toolbar height */
&.full-view {
.editor-pane {
width: 100%;
}
}
&.split-view {
.editor-pane {
width: 50%;
border-right: 1px solid var(--bs-border-color);
}
.preview-pane {
width: 50%;
}
}
}
.editor-pane {
display: flex;
flex-direction: column;
height: 100%;
.markdown-textarea {
border: none;
border-radius: 0;
resize: none;
flex: 1;
height: 100%;
font-family: 'JetBrains Mono', 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
font-size: 0.875rem;
line-height: 1.6;
padding: 1rem;
background: var(--bs-body-bg);
color: var(--bs-body-color);
&:focus {
box-shadow: none;
border-color: transparent;
outline: none;
background: rgba(var(--bs-primary-rgb), 0.02);
}
&::placeholder {
color: var(--bs-secondary);
opacity: 0.6;
}
}
}
.preview-pane {
display: flex;
flex-direction: column;
background: rgba(var(--bs-primary-rgb), 0.01);
height: 100%;
.preview-header {
padding: 0.75rem 1rem;
background: linear-gradient(135deg, var(--bs-light) 0%, rgba(var(--bs-success-rgb, 25, 135, 84), 0.05) 100%);
border-bottom: 1px solid var(--bs-border-color);
h6 {
color: var(--bs-secondary);
font-weight: 600;
margin: 0;
display: flex;
align-items: center;
gap: 0.5rem;
&::before {
content: "👁";
font-size: 1rem;
}
}
}
.markdown-preview {
flex: 1;
padding: 1rem;
overflow-y: auto;
height: calc(100% - 50px);
/* Custom scrollbar */
&::-webkit-scrollbar {
width: 6px;
}
&::-webkit-scrollbar-track {
background: transparent;
}
&::-webkit-scrollbar-thumb {
background: rgba(var(--bs-primary-rgb), 0.2);
border-radius: 3px;
&:hover {
background: rgba(var(--bs-primary-rgb), 0.3);
}
}
}
}
/* Markdown Content Styles */
.markdown-content, .card-description-content {
line-height: 1.7;
color: var(--bs-body-color);
font-size: 0.9rem; /* Slightly smaller base font */
h1, h2, h3, h4, h5, h6 {
margin-top: 1.75rem;
margin-bottom: 0.875rem;
font-weight: 600;
line-height: 1.3;
color: var(--bs-emphasis-color);
&:first-child {
margin-top: 0;
}
}
h1 {
font-size: 1.4rem; /* Even smaller H1 */
border-bottom: 3px solid var(--bs-primary);
padding-bottom: 0.75rem;
margin-bottom: 1.5rem;
background: linear-gradient(135deg, var(--bs-primary), var(--bs-info));
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
}
h2 {
font-size: 1.1rem; /* Even smaller H2 */
border-bottom: 2px solid rgba(var(--bs-primary-rgb), 0.3);
padding-bottom: 0.5rem;
margin-bottom: 1.25rem;
}
h3 {
font-size: 1.25rem;
color: var(--bs-primary);
position: relative;
&::before {
content: "";
color: var(--bs-primary);
margin-right: 0.5rem;
font-size: 0.8em;
}
}
h4 {
font-size: 1.125rem;
color: var(--bs-secondary);
}
h5, h6 {
font-size: 1rem;
color: var(--bs-secondary);
text-transform: uppercase;
letter-spacing: 0.5px;
font-weight: 700;
}
p {
margin-bottom: 1.25rem;
text-align: justify;
&:last-child {
margin-bottom: 0;
}
}
ul, ol {
margin-bottom: 1.25rem;
padding-left: 1.75rem;
li {
margin-bottom: 0.5rem;
line-height: 1.6;
position: relative;
&::marker {
color: var(--bs-primary);
font-weight: bold;
}
}
ul, ol {
margin-bottom: 0.75rem;
margin-top: 0.5rem;
}
}
blockquote {
margin: 1.5rem 0;
padding: 1rem 1.5rem;
border-left: 5px solid var(--bs-primary);
background: linear-gradient(135deg, rgba(var(--bs-primary-rgb), 0.08) 0%, rgba(var(--bs-primary-rgb), 0.03) 100%);
border-radius: 0 0.5rem 0.5rem 0;
font-style: italic;
position: relative;
&::before {
content: "\201C";
font-size: 3rem;
color: rgba(var(--bs-primary-rgb), 0.3);
position: absolute;
top: -0.5rem;
left: 0.5rem;
font-family: Georgia, serif;
}
p:last-child {
margin-bottom: 0;
}
}
code {
background: linear-gradient(135deg, var(--bs-light) 0%, rgba(var(--bs-info-rgb), 0.1) 100%);
padding: 0.25rem 0.5rem;
border-radius: 0.375rem;
font-family: 'JetBrains Mono', 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
font-size: 0.85em;
border: 1px solid rgba(var(--bs-info-rgb), 0.2);
color: var(--bs-info);
font-weight: 500;
}
pre {
background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
color: #f8f9fa;
padding: 1.5rem;
border-radius: 0.75rem;
overflow-x: auto;
margin: 1.5rem 0;
border: 1px solid rgba(var(--bs-primary-rgb), 0.2);
box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
position: relative;
&::before {
content: "Code";
position: absolute;
top: 0.5rem;
right: 1rem;
font-size: 0.75rem;
color: rgba(255, 255, 255, 0.5);
text-transform: uppercase;
letter-spacing: 1px;
}
code {
background: transparent;
padding: 0;
color: inherit;
border: none;
}
}
table {
width: 100%;
border-collapse: collapse;
margin: 1.5rem 0;
border-radius: 0.5rem;
overflow: hidden;
box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
th, td {
border: 1px solid var(--bs-border-color);
padding: 0.75rem 1rem;
text-align: left;
}
th {
background: linear-gradient(135deg, var(--bs-primary) 0%, rgba(var(--bs-primary-rgb), 0.8) 100%);
color: white;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.5px;
font-size: 0.875rem;
}
tr:nth-child(even) {
background: rgba(var(--bs-primary-rgb), 0.03);
}
tr:hover {
background: rgba(var(--bs-primary-rgb), 0.08);
transition: background-color 0.2s ease;
}
}
hr {
margin: 3rem 0;
border: none;
height: 3px;
background: linear-gradient(90deg, transparent 0%, var(--bs-primary) 50%, transparent 100%);
border-radius: 1.5px;
}
a {
color: var(--bs-primary);
text-decoration: none;
font-weight: 500;
position: relative;
transition: all 0.2s ease;
&::after {
content: "";
position: absolute;
bottom: -2px;
left: 0;
width: 0;
height: 2px;
background: var(--bs-primary);
transition: width 0.3s ease;
}
&:hover {
color: var(--bs-primary);
&::after {
width: 100%;
}
}
}
strong, b {
font-weight: 700;
color: var(--bs-emphasis-color);
}
em, i {
font-style: italic;
color: var(--bs-secondary);
}
del, s {
text-decoration: line-through;
opacity: 0.7;
}
// Task lists
input[type="checkbox"] {
margin-right: 0.75rem;
transform: scale(1.2);
accent-color: var(--bs-primary);
}
/* Inline elements */
mark {
background: linear-gradient(135deg, rgba(var(--bs-warning-rgb), 0.3) 0%, rgba(var(--bs-warning-rgb), 0.1) 100%);
padding: 0.125rem 0.25rem;
border-radius: 0.25rem;
}
}
/* Card Description Specific Styles */
.card-description {
.card-description-content {
font-size: 0.8rem; /* Slightly smaller base font for card description */
color: var(--bs-secondary);
h1, h2, h3, h4, h5, h6 {
margin-top: 0.75rem;
margin-bottom: 0.25rem;
&:first-child {
margin-top: 0;
}
}
h1 { font-size: 0.9rem; } /* Smaller H1 for card description */
h2 { font-size: 0.85rem; } /* Smaller H2 for card description */
h3 { font-size: 0.9rem; }
h4 { font-size: 0.875rem; }
h5 { font-size: 0.85rem; }
h6 { font-size: 0.8rem; }
p {
margin-bottom: 0.5rem;
}
ul, ol {
margin-bottom: 0.5rem;
padding-left: 1rem;
}
blockquote {
margin: 0.5rem 0;
padding: 0.25rem 0.5rem;
font-size: 0.8rem;
}
pre {
margin: 0.5rem 0;
padding: 0.5rem;
font-size: 0.75rem;
}
table {
margin: 0.5rem 0;
font-size: 0.8rem;
th, td {
padding: 0.25rem;
}
}
}
}
/* Dark theme adjustments */
.dark-theme {
.markdown-toolbar {
background: var(--bs-dark);
border-bottom-color: var(--bs-border-color);
}
.preview-header {
background: var(--bs-dark);
border-bottom-color: var(--bs-border-color);
}
.markdown-content, .card-description-content {
blockquote {
background: var(--bs-dark);
}
code {
background: var(--bs-dark);
}
pre {
background: var(--bs-light);
color: var(--bs-dark);
}
table {
th {
background: var(--bs-dark);
}
tr:nth-child(even) {
background: var(--bs-dark);
}
}
}
}
/* Responsive adjustments */
@media (max-width: 768px) {
.markdown-editor-container.widescreen {
top: 20px;
left: 20px;
right: 20px;
bottom: 20px;
}
.markdown-editor.split-view {
flex-direction: column;
.editor-pane {
width: 100%;
border-right: none;
border-bottom: 1px solid var(--bs-border-color);
}
.preview-pane {
width: 100%;
}
}
}
/* Kanban Card Edit Button Styles */
.card-title-row {
display: flex;
justify-content: space-between;
align-items: flex-start;
gap: 0.5rem;
}
.btn-edit-card {
background: none;
border: none;
color: var(--bs-secondary);
padding: 0.25rem;
border-radius: 0.25rem;
transition: all 0.2s ease;
opacity: 0.6;
&:hover {
color: var(--bs-primary);
background: rgba(var(--bs-primary-rgb), 0.1);
opacity: 1;
transform: scale(1.1);
}
&:focus {
outline: none;
box-shadow: 0 0 0 2px rgba(var(--bs-primary-rgb), 0.25);
}
i {
font-size: 0.875rem;
}
}
.card-title {
flex: 1;
margin: 0;
}
/* Markdown Description View Styles */
.markdown-description-view {
border: 1px solid var(--bs-border-color);
border-radius: 0.5rem;
background: var(--bs-body-bg);
.description-header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 0.75rem 1rem;
background: linear-gradient(135deg, var(--bs-light) 0%, rgba(var(--bs-primary-rgb), 0.05) 100%);
border-bottom: 1px solid var(--bs-border-color);
border-radius: 0.5rem 0.5rem 0 0;
.form-label {
margin: 0;
font-weight: 600;
color: var(--bs-body-color);
}
.btn-edit-description {
background: none;
border: none;
color: var(--bs-secondary);
padding: 0.375rem;
border-radius: 0.25rem;
transition: all 0.2s ease;
opacity: 0.7;
&:hover {
color: var(--bs-primary);
background: rgba(var(--bs-primary-rgb), 0.1);
opacity: 1;
transform: scale(1.1);
}
&:focus {
outline: none;
box-shadow: 0 0 0 2px rgba(var(--bs-primary-rgb), 0.25);
}
i {
font-size: 0.875rem;
}
}
}
.description-content {
height: 200px; /* 1/3 of typical form height */
overflow-y: auto;
padding: 1rem;
/* Custom scrollbar */
&::-webkit-scrollbar {
width: 6px;
}
&::-webkit-scrollbar-track {
background: transparent;
}
&::-webkit-scrollbar-thumb {
background: rgba(var(--bs-primary-rgb), 0.2);
border-radius: 3px;
&:hover {
background: rgba(var(--bs-primary-rgb), 0.3);
}
}
.empty-description {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100%;
text-align: center;
gap: 0.5rem;
i {
font-size: 2rem;
opacity: 0.5;
}
span {
font-size: 0.875rem;
opacity: 0.7;
}
}
}
}
.markdown-description-editor {
border: 1px solid var(--bs-border-color);
border-radius: 0.5rem;
background: var(--bs-body-bg);
.editor-header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 0.75rem 1rem;
background: linear-gradient(135deg, var(--bs-primary) 0%, rgba(var(--bs-primary-rgb), 0.8) 100%);
color: white;
border-radius: 0.5rem 0.5rem 0 0;
h6 {
margin: 0;
font-weight: 600;
}
.btn {
color: white;
border-color: rgba(255, 255, 255, 0.3);
&:hover {
background: rgba(255, 255, 255, 0.1);
border-color: rgba(255, 255, 255, 0.5);
}
}
}
.markdown-editor-container {
border: none;
border-radius: 0 0 0.5rem 0.5rem;
height: 400px; /* Larger height for editing */
}
}
/* Form group specific styles for description */
.description-form-group {
.markdown-description-view,
.markdown-description-editor {
width: 100%;
}
}