Sha256: 6c8a188752f21339d42d1eea2624c73f5507269a52f3b5c9045028f07b5d46a5

Contents?: true

Size: 1.4 KB

Versions: 2

Compression:

Stored size: 1.4 KB

Contents

//////////////////////////////
// Has Setting
//////////////////////////////
@function sgs-has($setting) {
  @if map-has-key($singularity, $setting) {
    @return true;
  }
  @else {
    @return false;
  }
}

//////////////////////////////
// Get Settings
//////////////////////////////
@function sgs-get($setting) {
  @if sgs-has($setting) {
    @return map-get($singularity, $setting);
  }
  @else {
    @return map-get($Singularity-Settings, $setting);
  }
}

//////////////////////////////
// Set Settings
//////////////////////////////
@function sgs-set($setting, $value) {
  @if (str-index($setting, '-') or str-index($setting, '_')) and str-index($setting, ' ') == null {
    @warn "Words in Singularity settings should be spaces, not dashes or underscores. Please replace dashes and underscores between words with spaces. Settings will not work as expected until changed.";
  }
  $singularity: map-merge($singularity, ($setting: $value)) !global;
  @return true;
}

@mixin sgs-change($setting, $value) {
  $sgs-change: sgs-set($setting, $value);
}

//////////////////////////////
// Remove Setting
//////////////////////////////
@function sgs-reset($settings...) {
  @if length($settings) == 1 {
    $settings: nth($settings, 1);
  }

  @each $setting in $settings {
    $singularity: map-remove($singularity, $setting) !global;
  }
  @return true;
}

@mixin sgs-reset($settings...) {
  $sgs-reset: sgs-reset($settings);
}

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
singularitygs-1.4.0 stylesheets/singularitygs/helpers/_settings.scss
singularitygs-1.3.0 stylesheets/singularitygs/helpers/_settings.scss