Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tweak card styles for better handling of card content #108

Merged
merged 1 commit into from
Dec 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion _docs-sources/courses.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Courses are offered through Teachable. Access is included with every Gruntwork s
author="Josh Padnick & Yoriyasu Yano"
authorImg="/img/courses/authors/josh-yori.png"
videos={30}
duration={90}
duration={92}
/>
<Course
title="A Crash Course on Docker + Packer"
Expand Down
4 changes: 2 additions & 2 deletions docs/courses.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Courses are offered through Teachable. Access is included with every Gruntwork s
author="Josh Padnick & Yoriyasu Yano"
authorImg="/img/courses/authors/josh-yori.png"
videos={30}
duration={90}
duration={92}
/>
<Course
title="A Crash Course on Docker + Packer"
Expand Down Expand Up @@ -58,5 +58,5 @@ Courses are offered through Teachable. Access is included with every Gruntwork s


<!-- ##DOCS-SOURCER-START
{"sourcePlugin":"Local File Copier","hash":"e7db12791a1d683580786b082c83953a"}
{"sourcePlugin":"Local File Copier","hash":"33744450a711b984427abb3c19bf1c77"}
##DOCS-SOURCER-END -->
11 changes: 10 additions & 1 deletion src/components/Card.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@
margin-bottom: 1rem;
}

.card .title {
margin-top: 1em;
margin-bottom: 0.75rem;
}

.card strong {
font-weight: 600;
}
Expand All @@ -30,7 +35,11 @@
display: inline;
}

.card p:last-child {
.card *:first-child {
margin-top: 0;
}

.card *:last-child {
margin-bottom: 0;
}

Expand Down
2 changes: 1 addition & 1 deletion src/components/Card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const Card: React.FunctionComponent<CardProps> = ({
const body = (
<div className={styles.card}>
{icon && <img className={styles.icon} alt={title} src={icon} />}
<h3>{title}</h3>
<h3 className={styles.title}>{title}</h3>
<div>{children || description}</div>
{tags && (
<ul className={styles.tags}>
Expand Down
17 changes: 16 additions & 1 deletion src/components/CenterLayout.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from "react"
import clsx from "clsx"
import styles from "./CenterLayout.module.css"

/**
Expand All @@ -9,10 +10,24 @@ import styles from "./CenterLayout.module.css"
* hide_table_of_contents: true
* hide_title: true
* ---
*
* You should then wrap _all_ content on the page between <CenterLayout> tags:
*
* <CenterLayout>
*
* # Page Title
*
* Content…
*
* </CenterLayout>
*
* Also note: The "markdown" class being applied is essential to preserve
* default styles applied by the theme e.g. with `.markdown > h2` selectors
*
* */

export const CenterLayout: React.FunctionComponent<any> = ({ children }) => {
return <div className={styles.center}>{children}</div>
return <div className={clsx(styles.center, "markdown")}>{children}</div>
}

export default CenterLayout
1 change: 1 addition & 0 deletions src/components/Course.module.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.author {
color: gray;
margin: 1.5rem 0;
}

.author img {
Expand Down