🐛 Fixed emails appearing very wide in Outlook and improved email image sizes

closes https://github.com/TryGhost/Ghost/issues/11536

- bumps `@tryghost/kg-default-cards`
  - image and gallery cards now output `width/height` attributes on `img` elements with a max width of 600px
  - uses resized images where possible to keep email weight down
- adds `height: auto` style to image card images so that the `height` attribute does not cause distortion at smaller screen widths
This commit is contained in:
Kevin Ansfield 2020-08-18 15:33:40 +01:00
parent cada88975a
commit cefcdad090
3 changed files with 18 additions and 7 deletions

View File

@ -367,6 +367,7 @@ figure blockquote p {
.kg-image-card img { .kg-image-card img {
display: block; display: block;
margin: 0 auto; margin: 0 auto;
height: auto !important;
} }
.kg-bookmark-container { .kg-bookmark-container {

View File

@ -51,7 +51,7 @@
"@tryghost/job-manager": "0.1.0", "@tryghost/job-manager": "0.1.0",
"@tryghost/kg-card-factory": "2.1.1", "@tryghost/kg-card-factory": "2.1.1",
"@tryghost/kg-default-atoms": "2.0.1", "@tryghost/kg-default-atoms": "2.0.1",
"@tryghost/kg-default-cards": "2.4.1", "@tryghost/kg-default-cards": "2.5.0",
"@tryghost/kg-markdown-html-renderer": "2.0.1", "@tryghost/kg-markdown-html-renderer": "2.0.1",
"@tryghost/kg-mobiledoc-html-renderer": "3.0.1", "@tryghost/kg-mobiledoc-html-renderer": "3.0.1",
"@tryghost/magic-link": "0.4.13", "@tryghost/magic-link": "0.4.13",

View File

@ -452,15 +452,15 @@
resolved "https://registry.yarnpkg.com/@tryghost/kg-default-atoms/-/kg-default-atoms-2.0.1.tgz#3223ef5210d73af02c53795e5a5f1a9c5fc5bd92" resolved "https://registry.yarnpkg.com/@tryghost/kg-default-atoms/-/kg-default-atoms-2.0.1.tgz#3223ef5210d73af02c53795e5a5f1a9c5fc5bd92"
integrity sha512-0/Fx98ZIj/gyPglKg9HQP+cKPSBpbue1pnzh3E8hR4WXzqnSWMFA8VTUyMeI+8oNwxkxhZrWt5KifngHbBfw2A== integrity sha512-0/Fx98ZIj/gyPglKg9HQP+cKPSBpbue1pnzh3E8hR4WXzqnSWMFA8VTUyMeI+8oNwxkxhZrWt5KifngHbBfw2A==
"@tryghost/kg-default-cards@2.4.1": "@tryghost/kg-default-cards@2.5.0":
version "2.4.1" version "2.5.0"
resolved "https://registry.yarnpkg.com/@tryghost/kg-default-cards/-/kg-default-cards-2.4.1.tgz#a7039bdf83be4a32cfb6b92a1013563ab013ef1e" resolved "https://registry.yarnpkg.com/@tryghost/kg-default-cards/-/kg-default-cards-2.5.0.tgz#920eee1ded1051ee1b845ce0813b07fd2a6af05a"
integrity sha512-r7y//Uw+7r6JfPRJSMP+f3ZnQGJxCVVBi9Y0N/ruj7vy53WjwCYvKCGBmFNHc9fSv3Ad1kFL0A12EwiZKjCbcQ== integrity sha512-fw+SNWUO8ejkq/RGnTmSRh98nLjNVXl+qcoJFpGuodYiGrsMqI/QjpOX8JPVOrlHNrsHA7uTq0qKp4Y+i4QJSw==
dependencies: dependencies:
"@tryghost/kg-markdown-html-renderer" "^2.0.1" "@tryghost/kg-markdown-html-renderer" "^2.0.2"
"@tryghost/url-utils" "^0.6.14" "@tryghost/url-utils" "^0.6.14"
"@tryghost/kg-markdown-html-renderer@2.0.1", "@tryghost/kg-markdown-html-renderer@^2.0.1": "@tryghost/kg-markdown-html-renderer@2.0.1":
version "2.0.1" version "2.0.1"
resolved "https://registry.yarnpkg.com/@tryghost/kg-markdown-html-renderer/-/kg-markdown-html-renderer-2.0.1.tgz#2932b540c743aa59554f427b7debee527763d700" resolved "https://registry.yarnpkg.com/@tryghost/kg-markdown-html-renderer/-/kg-markdown-html-renderer-2.0.1.tgz#2932b540c743aa59554f427b7debee527763d700"
integrity sha512-NWRMnpcmqsLsjylqS6+EclLP0+mlAmCT1pjwcehlp+P8UWfWopwdOEOgfQO0lYOxlq3LIj2vfarXxEJoTV43GA== integrity sha512-NWRMnpcmqsLsjylqS6+EclLP0+mlAmCT1pjwcehlp+P8UWfWopwdOEOgfQO0lYOxlq3LIj2vfarXxEJoTV43GA==
@ -470,6 +470,16 @@
markdown-it-lazy-headers "^0.1.3" markdown-it-lazy-headers "^0.1.3"
markdown-it-mark "^3.0.0" markdown-it-mark "^3.0.0"
"@tryghost/kg-markdown-html-renderer@^2.0.2":
version "2.0.2"
resolved "https://registry.yarnpkg.com/@tryghost/kg-markdown-html-renderer/-/kg-markdown-html-renderer-2.0.2.tgz#e52f44c02e1b9c3a7dfe2a4840f07a5af2e8717e"
integrity sha512-gqGUEMQq/ZOCNfF2oBu1mGrGYfsh32ueG5zYj2jsYkzzWFgRZkaW7+zIMFCMtxeW3xKopYDQcCcwbiwP6R1afw==
dependencies:
markdown-it "^11.0.0"
markdown-it-footnote "^3.0.2"
markdown-it-lazy-headers "^0.1.3"
markdown-it-mark "^3.0.0"
"@tryghost/kg-mobiledoc-html-renderer@3.0.1": "@tryghost/kg-mobiledoc-html-renderer@3.0.1":
version "3.0.1" version "3.0.1"
resolved "https://registry.yarnpkg.com/@tryghost/kg-mobiledoc-html-renderer/-/kg-mobiledoc-html-renderer-3.0.1.tgz#b9aef8dec965f5f90eab8a530f44cc4e26cd305a" resolved "https://registry.yarnpkg.com/@tryghost/kg-mobiledoc-html-renderer/-/kg-mobiledoc-html-renderer-3.0.1.tgz#b9aef8dec965f5f90eab8a530f44cc4e26cd305a"