Skip to content

armgit / fider

Public Imported from GitHub
0

Open platform to collect and prioritize feedback

1.9 KB
Raw Blame
// Used by every stylesheet, so this module must not emit any CSS itself
// (otherwise it is duplicated into every CSS chunk). Global CSS belongs in index.scss.
@forward "variables/functions";
@forward "variables/colors";
@forward "variables/dark-colors";
@forward "variables/spacing";
@forward "variables/sizing";
@forward "variables/text";
@forward "utility/theme";

@use "variables/functions" as *;
@use "variables/dark-colors" as *;
@use "variables/text" as *;

/* @include get-theme("dark"); */
$colors: $dark-colors;

$all: (
  colors: $colors,
  font: $font,
  border: (
    radius: (
      small: 6px,
      medium: 8px,
      large: 12px,
      xlarge: 20px,
      full: 999px,
    ),
  ),
);

// get
@function get($key, $map: $all) {
  $keys: str-explode($key, ".");

  @if not deep-map-check($map, $keys...) {
    @error 'The argument $map: `#{$map}` doesn\'t has some of the $keys: `#{$keys}`!';
  }

  @return deep-map-get($map, $keys...);
}

// Queries
$medias: "sm", "md", "lg", "xl", "xl2";
$sm-width: 576px;
$md-width: 768px;
$lg-width: 992px;
$xl-width: 1200px;
$xl2-width: 1400px;

@mixin media($media) {
  @if $media == "sm" {
    @media only screen and (max-width: #{$md-width}) {
      @content;
    }
  } @else if $media == "md" {
    @media only screen and (min-width: #{$md-width}) {
      @content;
    }
  } @else if $media == "lg" {
    @media only screen and (min-width: #{$lg-width}) {
      @content;
    }
  } @else if $media == "xl" {
    @media only screen and (min-width: #{$xl-width}) {
      @content;
    }
  } @else if $media == "xl2" {
    @media only screen and (min-width: #{$xl2-width}) {
      @content;
    }
  }
}

@mixin disabled() {
  cursor: not-allowed;
  opacity: 0.45 !important;
  background-image: none !important;
  pointer-events: none !important;
}

@mixin dark-mode() {
  body[data-theme="dark"] & {
    @content;
  }
}

@mixin light-mode() {
  body[data-theme="light"] & {
    @content;
  }
}