Skip to content

Commit

Permalink
Fix positioning for images without caption in PDFs (#788)
Browse files Browse the repository at this point in the history
* Fix image positioning
* Fix gh action
* Simplify rules for styling aligned images

Co-authored-by: SteelWagstaff <[email protected]>
  • Loading branch information
fdalcin and SteelWagstaff authored Jun 22, 2021
1 parent 7fe7f68 commit 57c26d2
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .github/workflows/.pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ jobs:
node-version: '10'

- name: Install OS dependencies
run: sudo apt-get install libxml2-utils ghostscript poppler-utils
run: |
sudo apt update
sudo apt-get install libxml2-utils ghostscript poppler-utils
- name: Start required services
run: sudo systemctl start mysql.service
Expand Down
34 changes: 34 additions & 0 deletions packages/buckram/assets/styles/components/media/_images.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,40 @@
}
}

p {
img {
&.aligncenter {
margin: if-map-get($image-wrapper-margin-top, $type) auto if-map-get($image-wrapper-margin-bottom, $type);
text-align: center;
display: block;

@include caption-text-align(center);
}

&.alignleft {
float: left;
margin: if-map-get($image-wrapper-margin-top, $type) if-map-get($image-alignleft-margin-right, $type) if-map-get($floated-image-wrapper-margin-bottom, $type) 0;
padding-right: 0;

@include caption-text-align(left);
}

&.alignright {
float: right;
margin: if-map-get($image-wrapper-margin-top, $type) 0 if-map-get($floated-image-wrapper-margin-bottom, $type) if-map-get($image-alignright-margin-left, $type);
padding-left: 0;

@include caption-text-align(right);
}

@if $type != 'web' {
&.aligncenter, &.alignleft, &.alignright {
max-width: 50%;
}
}
}
}

@if $type == 'epub' {
figcaption,
.wp-caption-text {
Expand Down

0 comments on commit 57c26d2

Please sign in to comment.