Skip to content

Commit

Permalink
responsive column styling
Browse files Browse the repository at this point in the history
  • Loading branch information
dmca-glasgow committed Apr 29, 2022
1 parent e959b55 commit a2457d0
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 5 deletions.
2 changes: 1 addition & 1 deletion compiler/src/mdast/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ export async function mdastPhase(file: VFile, ctx: Context) {
linkProperties: { className: 'link' },
})
// custom plugins:
.use(embedAssetUrl)
.use(youtubeVideos)
.use(aliasDirectiveToSvg, ctx)
.use(removeEmptyParagraphs)
// .use(aliasDirectiveToTex, ctx)
.use(codeBlocks, ctx)
.use(columns)
.use(embedAssetUrl)
.use(images, ctx)
.use(pagebreaks);

Expand Down
20 changes: 20 additions & 0 deletions template/src/styles/columns.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
.columns {
display: flex;

.column {
flex: 1;

&:nth-child(2n+1) {
padding-right: 0.5rem;
}
&:nth-child(2n) {
padding-left: 0.5rem;
}
}
}

@media (max-width: 800px) {
.columns {
flex-direction: column;
}
}
5 changes: 1 addition & 4 deletions template/src/styles/images.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,13 @@ img {

figure {
text-align: center;
margin: 3rem auto;
.img-bg {
display: inline-block;
background: white;
width: 75%;
max-width: 100%;
height: auto;
margin-top: 3rem;
margin-right: auto;
margin-bottom: 3rem;
margin-left: auto;
}
svg.pdftex, svg.knitr-svg {
margin-bottom: 0;
Expand Down
1 change: 1 addition & 0 deletions template/src/styles/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,6 @@
@import './tex.scss';
@import './code.scss';
@import './boxouts.scss';
@import './columns.scss';
@import './view-options.scss';
@import './pdf.scss';

0 comments on commit a2457d0

Please sign in to comment.