From b8dbc971cd9dfac14a873b1479674fe913c01133 Mon Sep 17 00:00:00 2001 From: Ivan Reshetnikov Date: Fri, 29 Mar 2024 23:48:41 +0500 Subject: [PATCH] fix: make styles work in older browsers --- src/pages/notes/[...slug].astro | 55 ++++++++++++++++----------------- 1 file changed, 27 insertions(+), 28 deletions(-) diff --git a/src/pages/notes/[...slug].astro b/src/pages/notes/[...slug].astro index 422a73b..43a1b94 100644 --- a/src/pages/notes/[...slug].astro +++ b/src/pages/notes/[...slug].astro @@ -51,33 +51,32 @@ const formatDate = (date: Date) => { display: flex; gap: 5px; } - .content { - img { - width: 100%; - max-width: 700px; - margin-left: calc((100% - min(100%, 700px)) / 2); - margin-bottom: 20px; - cursor: pointer; - } - th, td { - border: 1px solid #444; - padding: 6px 10px; - } - th { - text-align: left; - } - table { - border-collapse: collapse; - width: 100%; - } - pre { - padding: 12px; - border-radius: 5px; - } - p > code { - background-color: #24292e; - padding: 2px 4px; - border-radius: 4px; - } + .content :global(img) { + width: 100%; + max-width: 700px; + margin-left: calc((100% - min(100%, 700px)) / 2); + margin-bottom: 20px; + cursor: pointer; + } + .content :global(th), + .content :global(td) { + border: 1px solid #444; + padding: 6px 10px; + } + .content :global(th) { + text-align: left; + } + .content :global(table) { + border-collapse: collapse; + width: 100%; + } + .content :global(pre) { + padding: 12px; + border-radius: 5px; + } + .content :global(code) { + background-color: #24292e; + padding: 2px 4px; + border-radius: 4px; }