Slide's Inline Style is Removed When Targeted by Responsive Breakpoints
See original GitHub issueWhen using the responsive setting, inline style is removed from the slick wrapper’s child (i.e. our content that is nested inside slick-slide) when they are targeted by a responsive breakpoint. This was largely unexpected because inline style is preserved if not targeted by responsive breakpoints. This affects both mobileFirst:
true or false.
====================================================================
jsFiddle
http://jsfiddle.net/e1n5he7e/6/
====================================================================
Steps to reproduce the problem
- Add responsive settings
- Load page in layout that would not be affected by breakpoints (i.e. if not
mobileFirst:true
window size is greater than breakpoint) . Inline style should be preserved (in the jsFiddle inline style is simplycolor:red
) - Load and/or Resize page so that responsive breakpoint becomes active. Inline style will be replaced.
====================================================================
What is the expected behaviour?
- inline style should be appended to by slick instead of replaced by slick
- behavior would be consistent one-way or the other (either always replace inline-style or never replace-inline style - regardless of responsive settings)
====================================================================
What is observed behaviour?
- inline style is replaced ONLY when affected by breakpoints
====================================================================
More Details
- Chrome 66 OSX
- jQuery 1.12.4
- Slick 1.9.0
- Did this work before? (I am unsure)
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:9
Top Results From Across the Web
Slick Slide Removes Inline Styling on Responsive Breakpoints
You have to remove originalSlides.removeAttr('style'); on line 826. It's a workaround but it works. Share.
Read more >slick - the last carousel you'll ever need - Ken Wheeler
slick is a responsive carousel jQuery plugin that supports multiple breakpoints, CSS3 transitions, touch events/swiping & much more!
Read more >CSS · Bootstrap
Grid classes apply to devices with screen widths greater than or equal to the breakpoint sizes, and override grid classes targeted at smaller...
Read more >TailwindCSS: Adds complexity, does nothing.
For example: Lifewire: Avoiding Inline Styles for CSS Design. ... and your team for years to come, and it's going to be hard...
Read more >How To Use CSS Breakpoints For Responsive Design
In other terms, CSS media query breakpoints are the pixel values that a developer can specify in the CSS code. An adjustment is...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@lillorme actually this works!! Bypassing the main element in slider… hahaha easy fix but works!
This works for me (Permanent Solution) https://stackoverflow.com/questions/52264591/slick-slide-removes-inline-styling-on-responsive-breakpoints/58632397#58632397