Enabling Breakpoints

Introduction to Responsive Design in Element Studio

This tutorial demonstrates how to enable responsive design for controls within Element Studio, allowing users to set different values at different breakpoints. This feature is particularly useful for creating adaptable web elements that respond to various device sizes.

Creating a Responsive Element

Setting Up the Element and Control

  1. Create a new element named “responsive demo” within Element Studio.
  2. Navigate to the design tab, add a control section named “design”, and then add a color picker control called “color”.
  3. Set up dynamic CSS to link the color control to the background color of the element.
  4. Adjust the default CSS to give the element a visible size, for example, setting both height and width to 200 pixels.

Enabling Responsive Features

  1. Add the responsive demo element to your page.
  2. Go to the design tab and open the settings for the color control to enable responsive design by choosing “enable media queries”.
  3. Clear any previously set values if the responsive settings do not immediately take effect.

Applying Responsive Settings

Adjusting Values at Different Breakpoints

After enabling media queries, you can set different color values at various breakpoints:

  1. Set an initial color at the default breakpoint.
  2. Adjust the element’s color at lower breakpoints to demonstrate responsiveness.
  3. Observe how Breakdance handles the CSS by applying changes only where values are present, avoiding unnecessary CSS duplication.

Additional Notes

It’s important to clear control values after enabling media queries to ensure that the responsive settings are applied correctly. This is a common step when transitioning an element to be responsive after its initial setup. By following these steps, users can effectively create responsive elements that adapt to different screen sizes seamlessly within Breakdance.