studiometa / scss-toolkit

A small and configurable SCSS Toolkit to boost your project! 🚀
MIT License
5 stars 0 forks source link

Add height base media query function #4

Closed perruche closed 5 years ago

perruche commented 5 years ago

Hey,

We often have to use custom based media query heights for each project. Currently we write it like regular css @media screen and (min-height: 48em) {}

Should we create a scss function which work like md ? Maybe something like @media #{mdh('s')} {} ?

titouanmathis commented 5 years ago

Could a new parameter to the media($breakoint, $type, $unit) function be enough?

We could have something looking like this:

@function media($breakpoint, $type: 'min', $unit: 'em', $orientation: 'width') {
  // ...
  @return '(min-#{$orientation}: #{$size})';
}
lusimeon commented 5 years ago

@titouanmathis it seems to be a good idea.

Furthermor, I think we should have a specific height based breakpoint map related to this function.

$breakpoints-height: (
  'xxs': ..,
  'xs': ..,
  's': ..,
  'm': ..
  'l': ..
  'xl': ..,
  'xxl': ..,
) !default;
titouanmathis commented 5 years ago

Fixed by #17.