Method for dynamically changing data structures based on media query breakpoints