From 78e69028e760f0d9a31f76e7a875d29199638bda Mon Sep 17 00:00:00 2001 From: Sergey Yarkov Date: Tue, 23 Aug 2022 17:38:01 +0300 Subject: [PATCH] remove unused css --- .../Counter/{Counter.scss => Counter.css} | 9 ++++---- src/components/Counter/Counter.tsx | 4 ++-- src/components/PageHeading/PageHeading.astro | 21 ++++++++++++++++--- src/components/PageHeading/PageHeading.scss | 14 ------------- src/layouts/default.astro | 5 +---- src/templates/About.astro | 2 ++ src/templates/Articles.astro | 2 ++ src/templates/Contacts.astro | 2 ++ src/templates/Home.astro | 2 +- src/templates/NotFound.astro | 2 +- src/templates/Projects.astro | 2 ++ src/utils/history.ts | 7 ------- 12 files changed, 36 insertions(+), 36 deletions(-) rename src/components/Counter/{Counter.scss => Counter.css} (80%) delete mode 100644 src/components/PageHeading/PageHeading.scss diff --git a/src/components/Counter/Counter.scss b/src/components/Counter/Counter.css similarity index 80% rename from src/components/Counter/Counter.scss rename to src/components/Counter/Counter.css index f8ea029..6af8d30 100644 --- a/src/components/Counter/Counter.scss +++ b/src/components/Counter/Counter.css @@ -7,8 +7,9 @@ border: 1px solid var(--border-color); border-radius: var(--border-radius-md); padding: 15px 5px; - & div { - display: flex; - column-gap: 3px; - } +} + +.counter div { + display: flex; + column-gap: 3px; } diff --git a/src/components/Counter/Counter.tsx b/src/components/Counter/Counter.tsx index f22d280..782380e 100644 --- a/src/components/Counter/Counter.tsx +++ b/src/components/Counter/Counter.tsx @@ -1,8 +1,8 @@ import type { Component } from "solid-js"; import { createSignal, createEffect } from "solid-js"; -import Button from "../Button"; -import "./Counter.scss"; +import Button from "@components/Button"; +import "./Counter.css"; const Counter: Component<{ tick?: number }> = (props) => { const [isRunned, setIsRunned] = createSignal(false); diff --git a/src/components/PageHeading/PageHeading.astro b/src/components/PageHeading/PageHeading.astro index fde49c7..74201ab 100644 --- a/src/components/PageHeading/PageHeading.astro +++ b/src/components/PageHeading/PageHeading.astro @@ -1,6 +1,4 @@ --- -import "./PageHeading.scss"; - export interface Props { heading: string; description?: string | undefined; @@ -10,8 +8,25 @@ const { heading, description } = Astro.props as Props; ---
-

+

{heading}

{description &&

{description}

}
+ + diff --git a/src/components/PageHeading/PageHeading.scss b/src/components/PageHeading/PageHeading.scss deleted file mode 100644 index 87defba..0000000 --- a/src/components/PageHeading/PageHeading.scss +++ /dev/null @@ -1,14 +0,0 @@ -.page-heading { - & h1 { - font-size: var(--font-size-4xl); - text-align: center; - margin-bottom: 15px; - } - & p { - font-size: var(--font-size-lg); - text-align: center; - max-width: 650px; - margin: 0 auto; - margin-bottom: 2.5rem; - } -} diff --git a/src/layouts/default.astro b/src/layouts/default.astro index 7d42720..93f0ce9 100644 --- a/src/layouts/default.astro +++ b/src/layouts/default.astro @@ -4,17 +4,15 @@ import type { Props as BaseHeadProps } from "@components/BaseHead.astro"; import { SITE_METADATA } from "@root/config"; import BaseHead from "@components/BaseHead.astro"; import BaseLayout from "@components/BaseLayout"; -import PageHeading from "@components/PageHeading"; import "@styles/global.scss"; export interface Props extends BaseHeadProps { lang?: string | undefined; - showPageHeading?: boolean | undefined; noIndex?: boolean | undefined; canonicalUrl?: string | undefined; } -const { title, description, lang = "ru", showPageHeading = true, noIndex = false, canonicalUrl } = Astro.props as Props; +const { title, description, lang = "ru", noIndex = false, canonicalUrl } = Astro.props as Props; --- @@ -23,7 +21,6 @@ const { title, description, lang = "ru", showPageHeading = true, noIndex = false
- {showPageHeading && }
diff --git a/src/templates/About.astro b/src/templates/About.astro index e53da94..1a26cb3 100644 --- a/src/templates/About.astro +++ b/src/templates/About.astro @@ -1,6 +1,7 @@ --- import { SITE_METADATA } from "@root/config"; import PageLayout from "@layouts/default.astro"; +import PageHeading from "@components/PageHeading"; import SkillsList from "@components/SkillsList"; import SkillsBlock from "@components/SkillsBlock"; @@ -15,6 +16,7 @@ const { skills } = SITE_METADATA; --- +
diff --git a/src/templates/Articles.astro b/src/templates/Articles.astro index d0f19b1..56ac1c6 100644 --- a/src/templates/Articles.astro +++ b/src/templates/Articles.astro @@ -1,5 +1,6 @@ --- import PageLayout from "@layouts/default.astro"; +import PageHeading from "@components/PageHeading"; import ArticlesList from "@components/ArticlesList"; import { transformArticles, formatToArticleBlocks } from "@utils/articles"; import { getLanguageFromURL } from "@root/utils"; @@ -14,6 +15,7 @@ const canonicalUrl = new URL(Astro.url.pathname, Astro.site); --- +
+
+
diff --git a/src/templates/NotFound.astro b/src/templates/NotFound.astro index 25bac24..e2e5080 100644 --- a/src/templates/NotFound.astro +++ b/src/templates/NotFound.astro @@ -7,7 +7,7 @@ const lang = getLanguageFromURL(Astro.url.pathname); const t = useTranslation(Astro); --- - +

404

{t("404.description")}

diff --git a/src/templates/Projects.astro b/src/templates/Projects.astro index 0e418bb..cb07e96 100644 --- a/src/templates/Projects.astro +++ b/src/templates/Projects.astro @@ -3,6 +3,7 @@ import { SITE_METADATA } from "@root/config"; import PageLayout from "@layouts/default.astro"; import ProjectsList from "@components/ProjectsList"; import ProjectItem from "@components/ProjectItem"; +import PageHeading from "@components/PageHeading"; import { getLanguageFromURL } from "@root/utils"; import { useTranslation } from "@i18n/utils"; @@ -12,6 +13,7 @@ const { projects } = SITE_METADATA; --- +
{projects.map((project) => )} diff --git a/src/utils/history.ts b/src/utils/history.ts index 7087c57..07b8142 100644 --- a/src/utils/history.ts +++ b/src/utils/history.ts @@ -1,10 +1,3 @@ -export const extendHistoryState = (state: object, url?: URL | string | undefined): void => { - const { history } = window; - const updated = Object.assign({}, history.state, state); - - history.replaceState(updated, "", url); -}; - export const deleteParamFromUrl = (param: string): string => { const params = new URLSearchParams(window.location.search); params.delete(param);