Explorar o código

hardcoding darkmode, fixing minor formatting

Medowar hai 1 mes
pai
achega
6f5ea935a9

+ 5 - 11
themes/tailwind-custom/css/style.css

@@ -2,13 +2,11 @@
 	padding-right:1.5rem
 }
 
-/* Utilities missing from the prebuilt tailwind.css, used by the post header byline */
-.inline-flex {
-	display:inline-flex
-}
-
-.gap-2 {
-	gap:0.5rem
+/* Utilities missing from the prebuilt tailwind.css */
+/* Post list headlines, matching the prose h1 size (2.25rem / 1.111) */
+.text-4xl {
+	font-size:2.25rem;
+	line-height:2.5rem
 }
 
 .anchor svg {
@@ -20,10 +18,6 @@
 	border-color: rgb(55 65 81/var(--tw-divide-opacity))!important;
 }
 
-.light .toc-wrapper {
-	border-color: rgb(229 231 235/var(--tw-divide-opacity))!important;
-}
-
 .toc-wrapper a, 
 .related-posts a,
 .recent-posts a {

+ 1 - 37
themes/tailwind-custom/layout.html.php

@@ -1,6 +1,6 @@
 <?php if (!defined('HTMLY')) die('HTMLy'); ?>
 <!DOCTYPE html>
-<html lang="<?php echo blog_language();?>" class="__variable_space scroll-smooth light" id="html-id">
+<html lang="<?php echo blog_language();?>" class="__variable_space scroll-smooth dark">
 <head>
 	<?php echo head_contents();?>
 	<?php echo $metatags;?>
@@ -11,16 +11,6 @@
 <body class="bg-white pl-[calc(100vw-100%)] text-black antialiased dark:bg-gray-950 dark:text-white">
 <?php if (facebook()) { echo facebook(); } ?>
 <?php if (login()) { toolbar(); } ?>
-<script>
-	var html = document.getElementById("html-id");
-    if (localStorage.getItem("tw-theme") === "dark") {
-		html.classList.remove('light');
-		html.classList.add('dark');
-    } else if (localStorage.getItem("tw-theme") === "light") {
-        html.classList.remove('dark');
-		html.classList.add('light');
-    }
-</script>
 	<section class="mx-auto max-w-3xl px-4 sm:px-6 xl:max-w-5xl xl:px-0">
 		<div class="flex h-screen flex-col justify-between font-sans">
 			<header class="flex items-center justify-between py-10">
@@ -41,17 +31,6 @@
 							<path stroke-linecap="round" stroke-linejoin="round" d="M21 21l-5.197-5.197m0 0A7.5 7.5 0 105.196 5.196a7.5 7.5 0 0010.607 10.607z"></path>
 						</svg>
 					</button>
-					<div class="mr-5">
-						<div class="relative inline-block text-left">
-							<div>
-								<button id="theme-toggle" type="button" aria-label="Theme Mode" aria-haspopup="menu" aria-expanded="false">
-									<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="h-6 w-6 text-gray-900 dark:text-gray-100">
-										<path d="M17.293 13.293A8 8 0 016.707 2.707a8.001 8.001 0 1010.586 10.586z"></path>
-									</svg>
-								</button>
-							</div>
-						</div>
-					</div>
 					<button aria-label="Toggle Menu" class="sm:hidden menu-open" id="menu-toggle">
 						<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="h-8 w-8 text-gray-900 dark:text-gray-100">
 							<path fill-rule="evenodd" d="M3 5a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM3 10a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM3 15a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1z" clip-rule="evenodd"></path>
@@ -140,21 +119,6 @@
 			}
 		};
 	</script>
-	<script>
-		var html = document.getElementById("html-id");
-		document.getElementById("theme-toggle").addEventListener("click", () => {
-			if (html.className.includes("dark")) {
-				html.classList.remove('dark');
-				html.classList.add('light');
-				localStorage.setItem("tw-theme", 'light');
-			} else {
-				html.classList.remove('light');
-				html.classList.add('dark');
-				localStorage.setItem("tw-theme", 'dark');
-			}
-		})
-
-	</script>
 	<script src="<?php echo theme_path();?>js/functions.js"></script>
 	<?php if (analytics()): ?><?php echo analytics() ?><?php endif; ?>
 </body>

+ 4 - 3
themes/tailwind-custom/main.html.php

@@ -58,7 +58,7 @@
                 <div class="space-y-6">
                     <div>
                         <?php if (!empty($p->link)) {?>
-                        <h2 class="text-2xl font-bold leading-8 tracking-tight">
+                        <h2 class="text-4xl font-extrabold tracking-tight">
                             <a class="text-gray-900 dark:text-gray-100" href="<?php echo $p->link;?>" target="_blank"><?php echo $p->title;?>
                                 <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor" style="display:inline-block;margin-left: 3px;" class=" bi bi-link-45deg" viewBox="0 0 16 16">
                                   <path d="M4.715 6.542 3.343 7.914a3 3 0 1 0 4.243 4.243l1.828-1.829A3 3 0 0 0 8.586 5.5L8 6.086a1 1 0 0 0-.154.199 2 2 0 0 1 .861 3.337L6.88 11.45a2 2 0 1 1-2.83-2.83l.793-.792a4 4 0 0 1-.128-1.287z"/>
@@ -67,16 +67,17 @@
                             </a>
                         </h2>                    
                         <?php } else { ?>
-                        <h2 class="text-2xl font-bold leading-8 tracking-tight">
+                        <h2 class="text-4xl font-extrabold tracking-tight">
                             <a class="text-gray-900 dark:text-gray-100" href="<?php echo $p->url;?>"><?php echo $p->title;?></a>
                         </h2>                        
                         <?php } ?>
                         <div class="flex flex-wrap">
                             <span class="mr-3 text-sm font-medium uppercase text-primary-500"><span class="tags"><?php echo $p->tag;?></span></span>
                         </div>
-                        <dl class="pt-1">
+                        <dl class="pt-2">
                             <dt class="sr-only"><?php echo i18n('posted_on');?></dt>
                             <dd class="text-base font-medium leading-6 text-gray-500 dark:text-gray-400"><time><?php echo format_date($p->date);?></time>
+                            • <span>by <a class="text-primary-500 hover:text-primary-600 dark:hover:text-primary-400" href="<?php echo $p->authorUrl;?>"><?php echo $p->authorName;?></a></span>
                             <?php if (authorized($p)):?> • <span><a href="<?php echo $p->url;?>/edit?destination=post"><?php echo i18n('edit');?></a></span><?php endif;?>
                             </dd>
                         </dl>

+ 1 - 4
themes/tailwind-custom/post.html.php

@@ -8,10 +8,7 @@
                         <div>
                             <dt class="sr-only"><?php echo i18n('posted_on');?></dt>
                             <dd class="text-base font-medium leading-6 text-gray-500 dark:text-gray-400"><time><?php echo format_date($p->date);?></time>
-                            • <span class="inline-flex items-center gap-2 align-middle">
-                                <img class="inline-block rounded-full" src="<?php echo $p->authorAvatar;?>" width="24" height="24" alt="<?php echo $p->authorName;?>"/>
-                                <a class="text-primary-500 hover:text-primary-600 dark:hover:text-primary-400" href="<?php echo $p->authorUrl;?>"><?php echo $p->authorName;?></a>
-                            </span>
+                            • <span><img class="mr-2 inline-block rounded-full align-middle" src="<?php echo $p->authorAvatar;?>" width="24" height="24" alt="<?php echo $p->authorName;?>"/><a class="text-primary-500 hover:text-primary-600 dark:hover:text-primary-400" href="<?php echo $p->authorUrl;?>"><?php echo $p->authorName;?></a></span>
                             • <span class="text-primary-500"><?php echo $p->category;?></span>
                             <?php if (authorized($p)):?> • <span><a href="<?php echo $p->url;?>/edit?destination=post"><?php echo i18n('edit');?></a></span><?php endif;?>
                             </dd>

+ 13 - 12
themes/tailwind-custom/profile.html.php

@@ -17,14 +17,9 @@
     <?php $img = get_image($p->body);?>
     <li class="py-12">
         <article>
-        <div class="space-y-2 xl:grid xl:grid-cols-4 xl:items-baseline xl:space-y-0">
+        <div class="space-y-2<?php if ($teaserType === 'trimmed'):?> xl:grid xl:grid-cols-4 xl:items-baseline xl:space-y-0<?php endif;?>">
+            <?php if ($teaserType === 'trimmed') :?>
             <dl>
-                <dt class="sr-only"><?php echo i18n('posted_on');?></dt>
-                <dd class="text-base font-medium leading-6 text-gray-500 dark:text-gray-400"><time><?php echo format_date($p->date);?></time>
-                <?php if (authorized($p)):?> • <span><a href="<?php echo $p->url;?>/edit?destination=post"><?php echo i18n('edit');?></a></span><?php endif;?>
-                </dd>
-                
-                <?php if ($teaserType === 'trimmed') :?>
                 <dt class="sr-only"><?php echo i18n('featured_image');?></dt>
                 <dd class="pt-4 pr-6">
                         <?php if (!empty($p->image)) {?>
@@ -46,14 +41,13 @@
                         <a class="thumbnail" href="<?php echo $p->url;?>"><img src="<?php echo $img;?>" width="100%" alt="<?php echo $p->title;?>"></a>
                         <?php } ?>
                 </dd>
-                <?php endif;?>
-                
             </dl>
-            <div class="space-y-5 xl:col-span-3">
+            <?php endif;?>
+            <div class="space-y-5<?php if ($teaserType === 'trimmed'):?> xl:col-span-3<?php endif;?>">
                 <div class="space-y-6">
                     <div>
                         <?php if (!empty($p->link)) {?>
-                        <h2 class="text-2xl font-bold leading-8 tracking-tight">
+                        <h2 class="text-4xl font-extrabold tracking-tight">
                             <a class="text-gray-900 dark:text-gray-100" href="<?php echo $p->link;?>" target="_blank"><?php echo $p->title;?>
                                 <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor" style="display:inline-block;margin-left: 3px;" class=" bi bi-link-45deg" viewBox="0 0 16 16">
                                   <path d="M4.715 6.542 3.343 7.914a3 3 0 1 0 4.243 4.243l1.828-1.829A3 3 0 0 0 8.586 5.5L8 6.086a1 1 0 0 0-.154.199 2 2 0 0 1 .861 3.337L6.88 11.45a2 2 0 1 1-2.83-2.83l.793-.792a4 4 0 0 1-.128-1.287z"/>
@@ -62,13 +56,20 @@
                             </a>
                         </h2>                    
                         <?php } else { ?>
-                        <h2 class="text-2xl font-bold leading-8 tracking-tight">
+                        <h2 class="text-4xl font-extrabold tracking-tight">
                             <a class="text-gray-900 dark:text-gray-100" href="<?php echo $p->url;?>"><?php echo $p->title;?></a>
                         </h2>                        
                         <?php } ?>
                         <div class="flex flex-wrap">
                             <span class="mr-3 text-sm font-medium uppercase text-primary-500"><span class="tags"><?php echo $p->tag;?></span></span>
                         </div>
+                        <dl class="pt-2">
+                            <dt class="sr-only"><?php echo i18n('posted_on');?></dt>
+                            <dd class="text-base font-medium leading-6 text-gray-500 dark:text-gray-400"><time><?php echo format_date($p->date);?></time>
+                            • <span>by <a class="text-primary-500 hover:text-primary-600 dark:hover:text-primary-400" href="<?php echo $p->authorUrl;?>"><?php echo $p->authorName;?></a></span>
+                            <?php if (authorized($p)):?> • <span><a href="<?php echo $p->url;?>/edit?destination=post"><?php echo i18n('edit');?></a></span><?php endif;?>
+                            </dd>
+                        </dl>
                     </div>
                     <div class="prose max-w-none text-gray-500 dark:text-gray-400 dark:prose-invert">
                         <?php if ($teaserType !== 'trimmed') :?>