
@import 'tweaks-temp';

@function scale-alpha($c, $a) {
  @return scale-color($c, $alpha: percentage(-1 + $a));
}

@function gtkalpha($c,$a) {
  @return unquote("alpha(#{$c},#{$a})");
}

// Function to convert px values to em
@function to_em($input, $base: 16px) {
  // multiplied and divided by 1000 to make up for round() shortcoming
  $em_value: ($input / $base) * 1.091 * 1000;
  @return round($em_value) / 1000 * 1em;
}

$asset_suffix: if($variant == 'dark', '-dark', '');
$asset_suffix_dark: if($titlebar == 'dark', '-dark', '');
$asset_suffix_win: if($titlebutton == 'circle', '', '-win');

// sizes
$font-size: 10;

$small_size: 16px;
$medium_size: 28px;
$large_size: 40px;

$base_padding: 6px;         // internal padding of elements
$base_margin: 4px;          // margin between elements
$cont_padding: 6px;
$menuitem_size: 28px;

// radiuses
$bt_radius: if($window == 'round', 4px, 2px);
$wm_radius: $bt_radius + $cont_padding;
$corner_radius: if($window == 'round', $wm_radius, 0);
$material_radius: if($window == 'round', $wm_radius, 3px);
$circular_radius: 9999px;

// Fixed icon sizes
$base_icon_size: 16px;
$medium_icon_size: $base_icon_size * 1.5; // 24px
$large_icon_size: $base_icon_size * 2; // 32px

// Scaled values
// Used in elements that follow text scaling factors
$scaled_padding: to_em(6px); // same as $base_padding

// Used for symbolic icons that scale
$scalable_icon_size: to_em(16px);
$medium_scalable_icon_size: $scalable_icon_size * 1.5;
$large_scalable_icon_size: $scalable_icon_size * 2;

// durations
$shorter_duration: 180ms;
$longer_duration: 270ms;
$ripple_duration: 450ms;

// timing functions
$standard_curve: cubic-bezier(0.4, 0.0, 0.2, 1);
$deceleration_curve: cubic-bezier(0.0, 0.0, 0.2, 1);
$acceleration_curve: cubic-bezier(0.4, 0.0, 1, 1);
$sharp_curve: cubic-bezier(0.4, 0.0, 0.6, 1);

// transition shorthands
$shorter_transition: all $shorter_duration $deceleration_curve;
$longer_transition: all $longer_duration $deceleration_curve;
$shadow_transition: box-shadow $shorter_duration $deceleration_curve;

$ease-out-quad: cubic-bezier(0.25, 0.46, 0.45, 0.94);
$backdrop_transition: 200ms ease-out;
