summaryrefslogtreecommitdiffci
path: root/internal
diff options
from:
to:
context:
space:
mode:
authorGravatar SayaAndy <montferrat@tuta.io> 2025-10-15 18:14:59 +0700
committerGravatar SayaAndy <montferrat@tuta.io> 2025-10-15 18:14:59 +0700
commit739a4af71187e82fd58956e5ad36f0baefddf3c4 (patch)
treeecd9e14fdffb24c89394bef0a6ad8e6cab66d9de /internal
parent454e2f3cd84b6c0b02a0c2936a574d3d9c35c5a1 (diff)
downloadweb-739a4af71187e82fd58956e5ad36f0baefddf3c4.tar.gz
web-739a4af71187e82fd58956e5ad36f0baefddf3c4.zip
feat: improve measurements in layout
Diffstat (limited to 'internal')
-rw-r--r--internal/lightgallery/html_renderer.go6
-rw-r--r--internal/tailwind/transformer.go24
2 files changed, 15 insertions, 15 deletions
diff --git a/internal/lightgallery/html_renderer.go b/internal/lightgallery/html_renderer.go
index f02b953..c2f785e 100644
--- a/internal/lightgallery/html_renderer.go
+++ b/internal/lightgallery/html_renderer.go
@@ -50,10 +50,10 @@ func (r *LightGalleryHTMLRenderer) renderLightGallery(w util.BufWriter, source [
galleryID := generateDivId(8)
w.WriteString(fmt.Sprintf(`
-<div class="justify-content-center display-block m-2">
- <hr class="border-t-4 border-dotted border-main-dark mt-2 mb-2 w-[80%%] ml-auto mr-auto">
+<div class="justify-content-center display-block m-1">
+ <hr class="border-t-3 border-dotted border-main-dark mt-1 mb-2 w-[80%%] ml-auto mr-auto">
<div id="lg-%s" class="inline-gallery-container relative ml-auto mr-auto"></div>
- <hr class="border-t-4 border-dotted border-main-dark mt-2 mb-2 w-[80%%] ml-auto mr-auto">
+ <hr class="border-t-3 border-dotted border-main-dark mt-1 mb-2 w-[80%%] ml-auto mr-auto">
</div>`, galleryID))
var dynamicElements []string
diff --git a/internal/tailwind/transformer.go b/internal/tailwind/transformer.go
index 4057ea4..f932533 100644
--- a/internal/tailwind/transformer.go
+++ b/internal/tailwind/transformer.go
@@ -17,44 +17,44 @@ func (t *TailwindTransformer) Transform(node *ast.Document, reader text.Reader,
switch node := n.(type) {
case *ast.Heading:
classes := map[int]string{
- 1: "font-patua text-4xl font-bold text-main-dark mb-6 tracking-[.0125rem]",
- 2: "font-spectral text-3xl font-bold text-main-dark mb-2 tracking-[.0125rem]",
- 3: "font-spectral text-2xl font-medium text-main-dark mb-1.5 tracking-[.0125rem]",
- 4: "font-spectral text-xl font-medium text-main-medium mb-1 tracking-[.0125rem]",
- 5: "font-spectral text-base font-medium text-main-medium mb-1 italic tracking-[.0125rem]",
- 6: "font-spectral text-base font-medium text-secondary mb-1",
+ 1: "font-patua text-4xl font-bold text-main-dark mb-3 tracking-[.0125rem]",
+ 2: "font-spectral text-3xl font-bold text-main-dark mb-1 tracking-[.0125rem]",
+ 3: "font-spectral text-2xl font-medium text-main-dark mb-0.8 tracking-[.0125rem]",
+ 4: "font-spectral text-xl font-medium text-main-medium mb-0.5 tracking-[.0125rem]",
+ 5: "font-spectral text-base font-medium text-main-medium mb-0.5 italic tracking-[.0125rem]",
+ 6: "font-spectral text-base font-medium text-secondary mb-0.5",
}
if class, ok := classes[node.Level]; ok {
node.SetAttribute([]byte("class"), []byte(class))
}
case *ast.Paragraph:
- node.SetAttribute([]byte("class"), []byte("text-base/[2] font-spectral tracking-[.0125rem] -indent-8 ml-8 mb-8"))
+ node.SetAttribute([]byte("class"), []byte("text-base/[2] font-spectral tracking-[.0125rem] -indent-8 ml-4 mb-8"))
case *ast.List:
if node.IsOrdered() {
- node.SetAttribute([]byte("class"), []byte("list-decimal list-inside space-y-2 mb-8 pl-8"))
+ node.SetAttribute([]byte("class"), []byte("list-decimal list-inside space-y-2 mb-4 pl-8"))
} else {
- node.SetAttribute([]byte("class"), []byte("list-disc list-inside space-y-2 mb-8 pl-8"))
+ node.SetAttribute([]byte("class"), []byte("list-disc list-inside space-y-2 mb-4 pl-8"))
}
case *ast.ListItem:
node.SetAttribute([]byte("class"), []byte("text-base/[2] font-spectral tracking-[.0125rem]"))
case *ast.Blockquote:
- node.SetAttribute([]byte("class"), []byte("border-l-1 border-main-medium bg-background-dark p-2 mb-2 italic"))
+ node.SetAttribute([]byte("class"), []byte("border-l-2 border-main-medium bg-background-dark p-1 mb-2 italic"))
case *ast.CodeSpan:
node.SetAttribute([]byte("class"), []byte("bg-background-dark"))
case *ast.CodeBlock, *ast.FencedCodeBlock:
- node.SetAttribute([]byte("class"), []byte("bg-background-dark p-2 rounded-lg overflow-x-auto mb-8"))
+ node.SetAttribute([]byte("class"), []byte("bg-background-dark p-1 rounded-lg overflow-x-auto mb-4"))
case *ast.Link:
node.SetAttribute([]byte("class"), []byte("text-secondary hover:text-main-dark underline"))
case *ast.Image:
- node.SetAttribute([]byte("class"), []byte("max-w-full h-auto rounded-lg shadow-lg mb-8"))
+ node.SetAttribute([]byte("class"), []byte("max-w-full h-auto rounded-lg shadow-lg mb-4"))
case *ast.Emphasis:
switch node.Level {