FlyingDR / scss-snippets

Collection of helpful SCSS mixins and functions to use into various projects
1 stars 2 forks source link

r-get() with fallback #22

Closed FlyingDR closed 6 years ago

FlyingDR commented 7 years ago

Sometimes it is useful to be able to get responsive configuration value with fallback to value from default responsive configuration. Example is size calculations that includes responsive offsets that may, or may not be defined for some particular responsive configuration.

r-get() should have support for such feature.

FlyingDR commented 6 years ago

Example of how it may look like inside:

$value: r-get($key, $responsive-default-id);
@if (r-has($key, $id)) {
  $value: r-get($key, $id);
}