ocr-time-capsule / css /styles.css
davanstrien's picture
davanstrien HF Staff
Configure OCR Time Capsule with default dataset and branding
c49cb47
raw
history blame
4.06 kB
/**
* Custom styles for OCR Text Explorer
* Extends Tailwind CSS with specific styling needs
*/
/* Custom scrollbar styling */
::-webkit-scrollbar {
width: 8px;
height: 8px;
}
::-webkit-scrollbar-track {
@apply bg-gray-100 dark:bg-gray-800;
}
::-webkit-scrollbar-thumb {
@apply bg-gray-400 dark:bg-gray-600 rounded;
}
::-webkit-scrollbar-thumb:hover {
@apply bg-gray-500 dark:bg-gray-500;
}
/* Firefox scrollbar */
* {
scrollbar-width: thin;
scrollbar-color: theme('colors.gray.400') theme('colors.gray.100');
}
.dark * {
scrollbar-color: theme('colors.gray.600') theme('colors.gray.800');
}
/* Smooth transitions for theme switching */
body {
transition: background-color 0.3s ease, color 0.3s ease;
}
/* Image panel sticky positioning adjustment */
.sticky {
position: -webkit-sticky;
position: sticky;
}
/* Diff content styling */
.diff-content {
line-height: 1.6;
word-break: break-word;
}
/* Keyboard hint styling */
kbd {
@apply inline-block px-2 py-1 text-xs font-semibold text-gray-800 bg-gray-100 border border-gray-300 rounded dark:bg-gray-700 dark:text-gray-200 dark:border-gray-600;
box-shadow: 0 1px 0 rgba(0, 0, 0, 0.1);
}
/* Loading spinner animation (in case Tailwind's animate-spin needs adjustment) */
@keyframes spin {
to {
transform: rotate(360deg);
}
}
.animate-spin {
animation: spin 1s linear infinite;
}
/* Tab hover effect */
nav button {
position: relative;
transition: color 0.2s ease;
}
nav button::after {
content: '';
position: absolute;
bottom: -2px;
left: 0;
right: 0;
height: 2px;
background-color: transparent;
transition: background-color 0.2s ease;
}
nav button:hover::after {
@apply bg-gray-300 dark:bg-gray-600;
}
/* Image loading state */
img {
@apply bg-gray-200 dark:bg-gray-700;
min-height: 200px;
}
img[src=""] {
visibility: hidden;
}
/* Print styles */
@media print {
header, footer {
display: none !important;
}
.no-print {
display: none !important;
}
main {
height: auto !important;
}
.diff-content {
page-break-inside: avoid;
}
}
/* Responsive adjustments */
@media (max-width: 768px) {
/* Stack panels vertically on mobile */
main.flex {
@apply flex-col;
}
/* Full width for panels on mobile */
main > div:first-child {
@apply w-full max-h-96;
}
/* Adjust text size */
.prose-sm {
@apply text-xs;
}
/* Hide keyboard hints on mobile */
footer .text-sm:last-child {
@apply hidden;
}
}
/* Focus styles for accessibility */
button:focus, input:focus, select:focus {
@apply outline-none ring-2 ring-blue-500 ring-offset-2 dark:ring-offset-gray-900;
}
/* Custom tooltip styles (if needed later) */
.tooltip {
@apply invisible absolute z-10 px-2 py-1 text-xs text-white bg-gray-900 rounded shadow-lg dark:bg-gray-700;
}
.tooltip-trigger:hover .tooltip {
@apply visible;
}
/* Preserve whitespace in diff views */
.whitespace-pre-wrap {
white-space: pre-wrap;
word-wrap: break-word;
}
/* Enhanced diff highlighting with better dark mode contrast */
.diff-delete {
@apply bg-red-200 dark:bg-red-950 text-red-800 dark:text-red-300;
text-decoration: line-through;
text-decoration-color: currentColor;
text-decoration-thickness: 2px;
}
.diff-insert {
@apply bg-green-200 dark:bg-green-950 text-green-800 dark:text-green-300;
position: relative;
}
/* Dark mode specific improvements */
.dark .prose {
@apply text-gray-200;
}
.dark .prose h3 {
@apply text-gray-100;
}
/* Remove this - handled inline with classes
.dark pre {
@apply bg-gray-800 text-gray-200;
} */
/* Line numbers for future enhancement */
.line-numbers {
counter-reset: line;
}
.line-numbers > div::before {
counter-increment: line;
content: counter(line);
@apply inline-block w-12 mr-4 text-right text-gray-400 dark:text-gray-600 select-none;
}