Skip to content

Commit

Permalink
✨(react) add responsive helper
Browse files Browse the repository at this point in the history
This helper provides handy functions to make components responsive.
  • Loading branch information
NathanVss committed Dec 12, 2023
1 parent 7b0686d commit 6dcafa9
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions packages/react/src/utils/_responsive.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
@use "sass:map";
@use "../cunningham-tokens" as *;

@function breakpoint($name, $tokens: $themes) {
@return map.get($tokens, 'default', 'theme', 'breakpoints', $name);
}

@mixin container($name, $tokens: $themes) {
$breakpoint: breakpoint($name, $tokens);
@container (max-width: #{$breakpoint}) {
@content;
}
}

0 comments on commit 6dcafa9

Please sign in to comment.