Sha256: aab740645dd0408e771c34d6c8f63b90856756c2413305e6688bdc9c6fa4bf6b

Contents?: true

Size: 1010 Bytes

Versions: 3

Compression:

Stored size: 1010 Bytes

Contents

@mixin define-width($width)
{
	@if is-unitless($width)
	{
		@include define-elastic-width(to-percentage-from-unitless($width));
	}
	@else if is-percentage($width)
	{
		@include define-elastic-width($width);
	}
	@else
	{
		@include define-fixed-width($width);
	}
}

@mixin define-elastic-width($width-percentage)
{
	$width-fraction: to-fraction-from-percentage($width-percentage);
	$approximate-width-percentage: number-approximate-low($width-percentage);

	@if is-round($approximate-width-percentage)
	{
		#{ select-class(width $approximate-width-percentage) },
		#{ select-class(width $width-fraction) }
		{
			@include set-width($approximate-width-percentage);
		}
	}
	@else
	{
		#{ select-class(width $width-fraction) }
		{
			@include set-width($approximate-width-percentage);
		}
	}
}

@mixin define-fixed-width($width)
{
	#{ select-class(width $width) }
	{
		@include set-width($width);
	}
}

@mixin define-widths($widths)
{
	@each $width in list-series($widths)
	{
		@include define-width($width);
	}
}

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
dashy-0.0.5 app/assets/stylesheets/dashy/define/_width.scss
dashy-0.0.3 app/assets/stylesheets/dashy/define/_width.scss
dashy-0.0.4 app/assets/stylesheets/dashy/define/_width.scss