-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Views & Default Styles Update - NO JS #59
Conversation
… instead of inline css
…s used to lazyload
… prop to imageSizer for consistancy.
…logic around lazyloading with JS
…need to be handled in application
All changes have been reviewed in the context of an actual project. |
Hi @mrdoinel, this looks great and those were needed updates. I have two comments or questions. The first one is about the tailwind support. The reason to use inline styling was to avoid depending on an external stylesheet, so that the image layout can be applied faster. You didn't notice any jumping content while applying styles when using Tailwind? The other is about the layout option. What was the reason to remove it? I think it must be that it's rarely being used? Thanks! |
@mrdoinel if you have a minute to test, here's the changes I did to add config options:
|
Changes to the way inline styles and css classes work:
Background color option has been removed as it can simply be added to either inline styles or classes. |
Major update regarding how the markup is being generated :
noscript
tagtailwind_css
config to tell if the default style should be added using tailwind CSS classes or regular inline styles. This will avoid the output of repetitive inline styles attributes markup when using tailwind CSS in your application.imageSizer
boolean option to tell if it should render the sizer markup : a div under the image that push the zone to a certain percentage. IfimageSizer
is false, you will need to properly set wrapper aspect-ratio usingwrapperClass
option which is making sizing easier for responsive aspect-ratio for example.imageClass
string option to set css classes on the img tag.layout
optionThis change how the wrapper element around image is added and how the default style is added : the wrapper and the default style around the image tag is only added if the Placeholder is setup or if
ImageSizer
option is set to true.Because I am removing the JS script and logic, this will require a breaking change version: 2.0.0