Created
May 12, 2020 11:47
-
-
Save ankedsgn/8b50c3ddf6d841b6fc99ebb784005d3b to your computer and use it in GitHub Desktop.
Inline ckeditor images
This file contains hidden or 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
//Better inline images from the wysiwyg editor | |
if ($('.user-content img[style]').length > 0){ | |
var inlineimg = $('.user-content img[style]'); | |
console.log(inlineimg); | |
inlineimg.css("width","").css("height",""); | |
} |
This file contains hidden or 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
// images in htlm field | |
// in custom.js, inline width and height is stripped | |
.user-content { | |
img[style*='float: right'] { | |
clear: both; | |
width: 100%; | |
margin: var(--vertSpace-sm) 0; | |
@include respond-to(small-screens) { | |
width: 50%; | |
margin: 0 0 var(--vertSpace-sm) var(--gutterWidth); | |
} | |
} | |
img[style*='float: left'] { | |
clear: both; | |
width: 100%; | |
margin: var(--vertSpace-sm) 0; | |
@include respond-to(small-screens) { | |
width: 50%; | |
margin: 0 var(--gutterWidth) var(--vertSpace-sm) 0; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment