-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix!: improve grid usage, alignment, and spacing (#24)
This commit is largely a refactor to make better use of grids by using grid-areas, but it also improves spacing between and alignment of elements by incorporating them into the grid. It also includes several fixes. * fix!: remove support for `null` date time Rather than providing an end date time with a value of `null` to signify that a position or experience is ongoing, the end property should now be omitted from a date. * refactor: use named `grid-area` for easier layout The header, main content, and footer are now part of the grid rows and have consistent spacing applied between them. Column and row spans have also been replaced with named column and row starts/ends. * fix: remove margin and padding from drawer The drawer is no longer contained within the wrapper with the margin/padding applied around the edges of the page. While the drawer would previously get pushed around by margin when scrolling to the bottom of page, the drawer now stays in place when scrolling. * fix: lock footer to the bottom of page The footer will now stay at the bottom of the page, regardless of the amount of content in the resume. This includes adding margin to the bottom of the page to prevent the footer from getting to close to the bottom. * fix: main content sizing and alignment When the document has less than a full page of content, it will no longer be centered and spread outward to fill the space. Now, content is always aligned to the top and minimized to fit the content. * fix: remove invalid `break-inside` property from main content The `break-inside: avoid-print` property has been removed from within the main content sections. While this would be desireable and does have some effect on the print layout of the document in Chrome, it is often buggy and causes rows to overlap. This is unsurprising, as the W3C's CSS Fragmentation Module does not define a `break-inside` property for `grid`s (https://www.w3.org/TR/css-break-3/#property-index), so we remove it. * fix: sections without date take full-width of main section A section without a date will now consume the width that would have otherwise been used by the date. This could be useful for an introductory (e.g. "about me") section, which would no date and could precede the rest of the document.
- Loading branch information
Showing
9 changed files
with
82 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
<footer class="col-span-3 text-center text-sm font-light italic"> | ||
<footer class="text-center text-sm font-light italic grid-in-footer"> | ||
{{ .footer | markdownify }} | ||
</footer> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,16 @@ | ||
<div | ||
class="relative mb-4 grid max-w-[8.5in] grid-cols-[min-content_[stack]_1fr] grid-rows-[[stack]_1fr] md:grid-cols-[1fr_min-content_[stack]_min-content] md:gap-5" | ||
class="relative grid min-h-screen max-w-[8.5in] grid-cols-resume grid-rows-resume gap-4 grid-areas-resume md:grid-cols-resume-md md:grid-areas-resume-md" | ||
> | ||
{{ partial "resume/drawer" . }} | ||
<main | ||
class="grid px-2 pt-4 [grid-area:stack] md:col-span-2 md:grid-cols-subgrid md:pl-4 md:pr-0" | ||
<div | ||
class="col-span-full row-span-full grid grid-cols-subgrid grid-rows-subgrid px-2 pb-2 pt-4 md:mx-4" | ||
> | ||
{{ partial "resume/header" . }} | ||
{{ range .sections }}{{ partial "resume/section" . }}{{ end }} | ||
</main> | ||
{{ partial "resume/footer" . }} | ||
<main | ||
class="grid auto-rows-min grid-cols-subgrid row-start-main row-end-main col-start-main col-end-date" | ||
> | ||
{{ range .sections }}{{ partial "resume/section" . }}{{ end }} | ||
</main> | ||
{{ partial "resume/footer" . }} | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,41 @@ | ||
{{ $dateFormat := "2006" }} | ||
<section class="col-span-2 my-2 gap-x-4 md:grid md:grid-cols-subgrid"> | ||
<section class="my-2 grid grid-cols-subgrid col-start-main col-end-date"> | ||
{{ with .title }} | ||
<h1 class="col-span-2 text-xl font-light capitalize"> | ||
<h1 class="text-xl font-light capitalize col-start-main col-end-date"> | ||
{{ . }} | ||
</h1> | ||
{{ end }} | ||
{{ range .entries }} | ||
{{ $startDate := "" }} | ||
{{ $endDate := "present" }} | ||
{{ with .date }} | ||
{{ $startDate = time.Format $dateFormat .start }} | ||
{{ with .end }}{{ $endDate = time.Format $dateFormat . }}{{ end }} | ||
{{ with .title }} | ||
<h2 class="text-lg font-medium col-start-main col-end-main"> | ||
{{ . }} | ||
</h2> | ||
{{ end }} | ||
<div class="break-inside-avoid-page"> | ||
<div class="flex items-center justify-between"> | ||
{{ with .title }} | ||
<h2 class="text-lg font-medium">{{ . }}</h2> | ||
{{ end }} | ||
{{ with .date }} | ||
<p class="whitespace-nowrap text-sm md:hidden"> | ||
{{ $startDate }} - | ||
{{ $endDate }} | ||
</p> | ||
{{ end }} | ||
</div> | ||
{{ with .name }} | ||
<h3 class="text-base font-light">{{ . }}</h3> | ||
{{ end }} | ||
{{ with .description }} | ||
<div class="prose prose-sm prose-invert"> | ||
{{ . | markdownify }} | ||
</div> | ||
{{ end }} | ||
</div> | ||
<div class="mx-auto hidden text-center text-sm md:block"> | ||
{{ with .date }} | ||
{{ with .date }} | ||
<div | ||
class="flex flex-row-reverse gap-1 whitespace-nowrap text-center text-sm col-start-date col-end-date md:row-span-3 md:block md:whitespace-normal" | ||
> | ||
{{ $startDate := time.Format $dateFormat .start }} | ||
{{ $endDate := "present" }} | ||
{{ with .end }}{{ $endDate = time.Format $dateFormat . }}{{ end }} | ||
<p>{{ $endDate }}</p> | ||
<p>|</p> | ||
<div class="before:content-['-'] md:before:content-['|']"></div> | ||
<p>{{ $startDate }}</p> | ||
{{ end }} | ||
</div> | ||
{{ end }} | ||
{{ with .name }} | ||
<h3 | ||
class="text-base font-light col-start-main col-end-date md:col-end-main" | ||
> | ||
{{ . }} | ||
</h3> | ||
{{ end }} | ||
<div | ||
class="{{ if .date }} | ||
md:col-end-main | ||
{{ end }} prose prose-sm prose-invert col-start-main col-end-date" | ||
> | ||
{{ .description | markdownify }} | ||
</div> | ||
{{ end }} | ||
</section> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters