diff --git a/pages/[...slug].tsx b/pages/[...slug].tsx index 2c577e48..05ca6e7a 100644 --- a/pages/[...slug].tsx +++ b/pages/[...slug].tsx @@ -26,7 +26,8 @@ type Props = { const Index: NextPage = props => ( diff --git a/pages/_app.tsx b/pages/_app.tsx index d1f613e5..b44f2e92 100644 --- a/pages/_app.tsx +++ b/pages/_app.tsx @@ -1,5 +1,6 @@ import 'src/style.css' import 'src/style/content.css' +import 'src/style/article.css' import 'src/style/marker/marker-table.css' import 'src/style/kazimir/image.css' import 'src/style/kazimir/video.css' diff --git a/src/components/Contacts/index.tsx b/src/components/Contacts/index.tsx index 27fd91e5..0bd47042 100644 --- a/src/components/Contacts/index.tsx +++ b/src/components/Contacts/index.tsx @@ -8,12 +8,12 @@ export const Contacts: React.FC = props => { <> diff --git a/src/components/Html/index.tsx b/src/components/Html/index.tsx index 74b3c30b..f7f552ce 100644 --- a/src/components/Html/index.tsx +++ b/src/components/Html/index.tsx @@ -1,7 +1,16 @@ +import { createElement } from 'react' + export type HtmlProps = { + className?: string + as?: keyof HTMLElementTagNameMap html: string } -export const Html: React.FC = props => ( -
-) +export const Html: React.FC = ({ as = 'div', ...props }) => { + return createElement(as, { + className: props.className, + dangerouslySetInnerHTML: { + __html: props.html, + } + }) +} diff --git a/src/components/HudozkaTitle/index.tsx b/src/components/HudozkaTitle/index.tsx index e0f1efcc..5450401b 100644 --- a/src/components/HudozkaTitle/index.tsx +++ b/src/components/HudozkaTitle/index.tsx @@ -17,7 +17,7 @@ export const HudozkaTitle: React.FC = memo(props => ( @media (max-width: 31.25em) { div { - --padding: 0 0 var(--double-margin); + --padding: 0 0 2em; } } `} diff --git a/src/components/Page/index.tsx b/src/components/Page/index.tsx index 09176002..efb74fb5 100644 --- a/src/components/Page/index.tsx +++ b/src/components/Page/index.tsx @@ -1,28 +1,24 @@ +import './styles.css' + import { Share } from '../Share' import { Html } from '../Html' import { PageMeta } from '../PageMeta' import { ITag } from 'src/types' -export interface IPageProps { +export type PageProps = { + style?: React.CSSProperties children: string date: Date tags: ITag[] } -export const Page: React.FC = props => ( -
- -
- -
+export const Page: React.FC = props => ( +
+
diff --git a/src/components/Page/styles.css b/src/components/Page/styles.css new file mode 100644 index 00000000..bfb179f0 --- /dev/null +++ b/src/components/Page/styles.css @@ -0,0 +1,5 @@ +.page hr { + border: 1px solid black; + margin-top: var(--size-m); + margin-bottom: var(--size-m); +} diff --git a/src/style.css b/src/style.css index 1f0e20a7..0017a251 100644 --- a/src/style.css +++ b/src/style.css @@ -8,20 +8,12 @@ --text-font: 'PT Sans', Helvetica, sans-serif; --smaller-font-size: 0.9rem; - --normal-font-size: 1rem; - --bigger-font-size: 1.2rem; - --big-font-size: 1.5rem; - --biggest-font-size: 2.25rem; /* MENU */ --menu-mark-thickness: 4px; /* SIZE */ --mobile-width: 31.25em; - --desktop-width: 59.99999em; - - --tablet-min-width: 31.25em; - --tablet-max-width: 64em; /* CONTENT */ --content-width: 60%; @@ -33,10 +25,11 @@ /* FONTS */ --font-size-default: 14pt; + --font-size-accent: 24pt; --font-size-second: 12pt; --font-size-h1: 5rem; - --font-size-h2: 2.5rem; + --font-size-h2: 3rem; --font-size-h3: 1.5rem; /* COLOR */ @@ -79,15 +72,14 @@ --shadow-active: 0 4px 16px var(--color-shadow); /* MARGINS */ - --small-margin: 0.2em; - --half-margin: 0.5em; --single-margin: 1em; - --double-margin: 2em; - --post-margin: 5em; /* OTHER */ --block-border-radius: 3px; + /* ARTICLE */ + --article-line-height: 1.5em; + /* KAZIMIR */ --kazimir-caption-margin: 0px; --kazimir-radius: 5px; @@ -114,7 +106,7 @@ footer { padding: var(--single-margin); color: var(--color-text-opposite); background-color: var(--color-back-opposite); - font-size: var(--smaller-font-size); + font-size: var(--font-size-second); } h1 { @@ -181,12 +173,8 @@ a.invisible { @media (max-width: 31.25em) { :root { - --smaller-font-size: 0.9rem; - --normal-font-size: 1rem; - --bigger-font-size: 1.1rem; - --big-font-size: 1.3rem; - --biggest-font-size: 2rem; - + --font-size-default: 14pt; + --font-size-accent: 16pt; --font-size-h1: 1.5rem; --font-size-h2: 1.5rem; --font-size-h3: 1.25rem; diff --git a/src/style/article.css b/src/style/article.css new file mode 100644 index 00000000..d271b05d --- /dev/null +++ b/src/style/article.css @@ -0,0 +1,74 @@ +.article { + hyphens: auto; +} + +.article h1 { + margin-bottom: var(--size-s); +} + +.article ul { + margin-left: var(--size-s); + margin-bottom: var(--single-margin); + + list-style: disc; +} + +.article ol { + margin-left: var(--size-s); + margin-bottom: var(--single-margin); +} + +.article li { + margin-bottom: var(--size-s); +} + +.article p { + margin-bottom: var(--size-m); + line-height: var(--article-line-height); +} + +.article p:last-child { + margin-bottom: 0; +} + +.article blockquote { + padding: var(--size-m); + font-size: var(--font-size-accent); +} + +.article cite { + display: block; + font-size: var(--font-size-default); + text-align: right; + + margin-top: var(--size-m); +} + +.article hr { + margin-bottom: var(--size-xl); + border: none; + height: 1px; + background: var(--dark-color); +} + +@media (max-width: 31.25em){ + .article blockquote { + padding: 0 + } + + /* .article { + --text-margin: 0; + } + + .article img { + max-height: 20em; + } + + .article ul { + margin-left: var(--single-margin); + } + + .article ol { + margin-left: var(--single-margin); + } */ +} diff --git a/src/style/components/Article.scss b/src/style/components/Article.scss deleted file mode 100644 index 79100fa9..00000000 --- a/src/style/components/Article.scss +++ /dev/null @@ -1,87 +0,0 @@ -.Article { - --article-line-height: 1.5em; - --article-quote-padding: var(--half-margin); - --article-quote-font-size: 1.25em; - - hyphens: auto; - margin-bottom: var(--post-margin); - - h1 { - margin-bottom: var(--size-s); - } - - &-Body { - ul, - ol { - margin-left: var(--half-margin); - margin-bottom: var(--single-margin); - - li { - margin-bottom: var(--half-margin); - } - } - - ul { - list-style: disc; - } - - p { - margin-bottom: var(--article-line-height); - line-height: var(--article-line-height); - } - - blockquote { - background-color: hsl(215, 10%, 96%); - padding: var(--article-quote-padding); - margin: var(--single-margin) 0; - font-family: var(--title-font); - font-style: italic; - font-weight: normal; - font-size: var(--article-quote-font-size); - - border-radius: var(--block-border-radius); - - cite { - margin-top: var(--single-margin); - display: block; - color: #aaa; - font-size: initial; - font-family: var(--text-font); - text-align: right; - margin-right: var(--single-margin); - } - - p { - margin-bottom: 0; - } - } - - hr { - margin-bottom: var(--double-margin); - border: none; - height: 1px; - background: var(--dark-color); - } - } -} - -@media (max-width: var(--mobile-width)) { - .Article { - --article-line-height: 1.5em; - --article-quote-padding: 0.5em; - --article-quote-font-size: 1em; - - &-Body { - --text-margin: 0; - - img { - max-height: 20em; - } - - ul, - ol { - margin-left: var(--single-margin); - } - } - } -} diff --git a/src/style/components/document-row.scss b/src/style/components/document-row.scss index 514479dc..23e5487e 100644 --- a/src/style/components/document-row.scss +++ b/src/style/components/document-row.scss @@ -43,7 +43,7 @@ @media (max-width: var(--mobile-width)) { .document-row__file { - margin-left: var(--half-margin); + margin-left: var(--size-s); } .document-row__file-info { diff --git a/src/style/components/document.scss b/src/style/components/document.scss index e7af27fd..1cc23000 100644 --- a/src/style/components/document.scss +++ b/src/style/components/document.scss @@ -3,7 +3,7 @@ flex-direction: column; align-items: center; padding: 0; - margin-bottom: var(--double-margin); + margin-bottom: var(--size-xl); } .document__image{ diff --git a/src/style/marker/marker-table.css b/src/style/marker/marker-table.css index bb40307d..56e6fdbe 100644 --- a/src/style/marker/marker-table.css +++ b/src/style/marker/marker-table.css @@ -1,6 +1,6 @@ .MarkerTable { width: 100%; - margin-bottom: var(--double-margin); + margin-bottom: var(--size-l); border-spacing: 0; border-collapse: separate; diff --git a/src/style/style.scss b/src/style/style.scss index be6ff9d1..19c97863 100644 --- a/src/style/style.scss +++ b/src/style/style.scss @@ -1,3 +1,2 @@ @import "components/document"; @import "components/document-row"; -@import "components/Article";