Development
How to implement the SDS grid system in development.
Available Mixin
To implement the grid system and target different breakpoints effectively, use the provided sds-screen()
mixin. The "range" parameter should be the name of one of the available grid ranges from the SDS Breakpoints & Grid System table.
Example
Let's say a developer needs a component to have different colored text depending on which viewport/grid range the user is viewing it in. Using the sds-screen()
mixin, the SCSS
code would look something like this:
Notice that the grid-range @2xl
was not manually declared using the mixin. All current projects using SDS are developed using a desktop-first approach, which means that the initial @2xl
styles become the default declarations, with all other targeted grid-ranges and styles following after.
For the sds-screen()
mixin to work properly, it is necessary to write each targeted range in the correct descending order. If the mixin is not implemented in the correct descending order, it will not work as expected and your responsive layout behavior will be broken.
In many instances, it won't be necessary to manually declare each available grid-range. Sometimes a component or ui element will share the same layout/styles across multiple grid-ranges. In order to keep stylesheets as DRY as possible, developers only need to target a specific grid-range if they need to override a specific style for that range.
Last updated