GlossyApertures/source/common/common_common.scss

105 lines
3.3 KiB
SCSS

@function gtkalpha($c,$a) {
@return unquote("alpha(#{$c},#{$a})");
}
// Optional compact sizes for buttons, headerbar and headerbar widgets
$_sizevariant: 'compact'; //either 'default', or compact otherwise
$_headerbar_height: if($_sizevariant=='default', 46px, 40px);
$_entry_height: if($_sizevariant=='default', 32px, 28px);
$_btn_pad: if($_sizevariant=='default', 4px 9px, 2px 6px);
$_hb_btn_pad: if($_sizevariant=='default', 6px, 5px);
$_img_btn_pad: if($_sizevariant=='default', 5px, 2px);
$_sel_menu_pad: if($_sizevariant=='default', 6px 10px, 4px 10px);
$_circ_btn_pad: if($_sizevariant=='default', 4px, 2px);
$_switch_margin: if($_sizevariant=='default', 10px, 7px);
$entry_radius: 0px;
$ease-out-quad: cubic-bezier(0.25, 0.46, 0.45, 0.94);
$asset_suffix: if($variant=='dark', '-dark', '');
$backdrop_transition: 200ms ease-out;
$button_transition: all 200ms $ease-out-quad;
$button_radius: 5px;
$tab_radius: $button_radius;
//added by me:
$button_min_height: 24px;
$button_min_width: 16px;
$button_padding: $_btn_pad;
$button_border: 1px solid;
@function image_gloss_well_contrasted($bg, $direction:bottom) {
@return image_gloss( if( lightness($bg) > 30%, 'light', 'dark'), $direction );
}
@function image_gloss($var:$variant, $direction:bottom) {
@return linear-gradient(
to $direction,
transparentize(white, if($var == 'light', 0.1 ,0.7 )),
transparentize(white, if($var == 'light', 0.5 ,0.7 )) 50%,
transparentize(white, 1) 50%,
transparentize(white, if($var == 'light',0.7,0.85)) );
}
$menu_radius: 5px;
%selected_items {
background-color: $selected_bg_color;
@at-root %nobg_selected_items, & {
color: $selected_fg_color;
@at-root %selected_items_disabled,
&:disabled { color: mix($selected_fg_color, $selected_bg_color, 50%); }
@at-root %selected_items_backdrop,
&:backdrop {
color: $backdrop_selected_fg_color;
background-color: $backdrop_selected_bg_color;
&:disabled { color: mix($backdrop_selected_fg_color, $selected_bg_color, 30%); }
}
}
}
@function _border_color($c, $darker: false) {
@if $darker == true { @return darken($c, 20%); }
@else { @return darken($c, 10%); }
}
@function _text_shadow_color ($tc: $fg_color, $bg: $bg_color) {
//
// calculate the color of text shadows
//
// $tc is the text color
// $bg is the background color
//
$_lbg: lightness($bg)/100%;
@if lightness($tc)<50% { @return transparentize(white, 1-$_lbg/($_lbg*1.3)); }
@else { @return transparentize(black, $_lbg*0.8); }
}
@function _button_hilight_color($c) {
//
// calculate the right top hilight color for buttons
//
// $c: base color;
//
@if lightness($c)>95% { @return white; }
@else if lightness($c)>90% { @return transparentize(white, 0.15); }
@else if lightness($c)>80% { @return transparentize(white, 0.35); }
@else if lightness($c)>50% { @return transparentize(white, 0.5); }
@else if lightness($c)>40% { @return transparentize(white, 0.65); }
@else { @return transparentize(white, 0.7); }
//@return $top_hilight;
}
//these are copied from button, surely there is a better way to DRY
$hilight_color: _button_hilight_color($dark_fill);
$button_shadow_normal: inset 0 -1px 1px transparentize($shadow_hard_color, 0.6);
$button_shadow_pressed: inset 0 1px 2px transparentize($shadow_hard_color, 0.6);