// Fylgja (https://fylgja.dev)
// Licensed under MIT Open Source

@use "props" as *;

$use-mq: true !default;
$utils: (
	"hidden": none,
	"block": block,
	"inline-block": inline flow-root,
	"flow-root": flow-root,
	"flex": flex,
	"inline-flex": inline flex,
	"grid": grid,
	"inline-grid": inline grid,
	"table-cell": table-cell,
) !default;

@each $class, $value in $utils {
	.#{$class} {
		display: $value;
	}
}

@each $class, $value in $utils {
	.open\:#{$class}:where([open], :popover-open) {
		display: $value;
	}
}

@mixin mq-utils($name) {
	@each $class, $value in $utils {
		.#{$name}\:#{$class} {
			display: $value;
		}
	}
}

@if $use-mq {
	@include for-mq using ($name) {
		@include mq-utils($name);
	}
}
