_drawing.scss
ASCII text
1// Drawing mixins 2 3// generic drawing of more complex things 4 5// provide font size in rem, with px fallback 6@mixin fontsize($size: 24, $base: 16) { 7font-size: round($size) + pt; 8//font-size: ($size / $base) * 1rem; 9} 10 11// shadows 12@mixin shadow($level) { 13@if $level==1 { 14box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24); 15} 16@if $level==2 { 17box-shadow: 0 3px 6px rgba(0,0,0,0.16*1.5), 0 3px 6px rgba(0,0,0,0.23*1.5); 18} 19@if $level==3 { 20box-shadow: 0 10px 20px rgba(0,0,0,0.19*1.5), 0 6px 6px rgba(0,0,0,0.23*1.5); 21} 22@if $level==4 { 23box-shadow: 0 14px 28px rgba(0,0,0,0.25*1.5), 0 10px 10px rgba(0,0,0,0.22*1.5); 24} 25@if $level==5 { 26box-shadow: 0 19px 38px rgba(0,0,0,0.30*1.5), 0 15px 12px rgba(0,0,0,0.22*1.5); 27} 28} 29 30// entries 31 32@mixin entry($t, $fc:$selected_bg_color) { 33// 34// Entries drawing function 35// 36// $t: entry type 37// $fc: focus color 38// 39// possible $t values: 40// normal, focus, insensitive 41// 42@if $t==normal { 43background-color: rgba(0, 0, 0, 0.01); 44border-color: transparent; 45box-shadow: inset 0 -1px if($fc!=$selected_bg_color, $fc, $fill_color); 46 47} 48@if $t==focus { 49border-color: transparent; 50box-shadow: inset 0 -2px if($fc!=$selected_bg_color, $fc, $selected_bg_color); 51} 52@if $t==hover { } 53@if $t==insensitive { 54color: $insensitive_fg_color; 55border-color: transparent; 56box-shadow: inset 0 -1px if($fc!=$selected_bg_color, $fc, $insensitive_fill_color); 57} 58} 59 60// buttons 61 62@mixin button($t, $c:$bg_color, $tc:$fg_color) { 63// 64// Button drawing function 65// 66// $t: button type, 67// $c: base button color for colored* types 68// $tc: optional text color for colored* types 69// 70// possible $t values: 71// normal, hover, active, insensitive, undecorated 72// 73@if $t==normal { 74// 75// normal button 76// 77color: if($tc!=$fg_color, $tc, $secondary_fg_color); 78background-color: $c; 79border-color: transparent; 80@include shadow(1); 81text-shadow: none; 82icon-shadow: none; 83} 84@if $t==focus { 85// 86// focused button 87// 88color: $tc; 89text-shadow: none; 90icon-shadow: none; 91box-shadow: 0 0 transparent; 92// box-shadow: inset 0px 0px 0px 2px $fill_color; 93} 94 95@else if $t==hover { 96// 97// hovered button 98// 99color: if($tc!=$fg_color, $tc, $fg_color); 100background-color: $c; 101border-color: transparent; 102@include shadow(2); 103text-shadow: none; 104icon-shadow: none; 105 106} 107@else if $t==active { 108// 109// pushed button 110// 111color: if($tc!=$fg_color, $tc, $fg_color); 112background-color: mix($tc, $c, 20%); 113border-color: transparent; 114@include shadow(2); 115text-shadow: none; 116icon-shadow: none; 117} 118@else if $t==insensitive { 119// 120// insensitive button 121// 122color: if($tc!=$fg_color, $tc, $insensitive_secondary_fg_color); 123background-color: if($c!=$bg_color, $c, $insensitive_fill_color); 124border-color: transparent; 125box-shadow: 0 0 transparent; 126text-shadow: none; 127icon-shadow: none; 128} 129@if $t==flat-normal { 130// 131// normal flat button 132// 133color: if($tc!=$fg_color, $tc, $secondary_fg_color); 134background-color: transparent; 135border-color: transparent; 136box-shadow: 0 0 transparent; 137text-shadow: none; 138icon-shadow: none; 139} 140@if $t==flat-focus { 141// 142// focused flat button 143// 144color: $tc; 145text-shadow: none; 146icon-shadow: none; 147box-shadow: 0 0 transparent; 148// box-shadow: inset 0px 0px 0px 2px $fill_color; 149} 150 151@else if $t==flat-hover { 152// 153// hovered flat button 154// 155color: if($tc!=$fg_color, $tc, $fg_color); 156background-color: if($c!=$bg_color, $c, $semi_fill_color); 157border-color: transparent; 158box-shadow: 0 0 transparent; 159text-shadow: none; 160icon-shadow: none; 161 162} 163@else if $t==flat-active { 164// 165// pushed flat button 166// 167color: if($tc!=$fg_color, $tc, $fg_color); 168background-color: if($c!=$bg_color, $c, $fill_color); 169border-color: transparent; 170box-shadow: 0 0 transparent; 171text-shadow: none; 172icon-shadow: none; 173} 174@else if $t==flat-insensitive { 175// 176// insensitive flat button 177// 178color: if($tc!=$fg_color, $tc, $insensitive_secondary_fg_color); 179background-color: transparent; 180border-color: transparent; 181box-shadow: 0 0 transparent; 182text-shadow: none; 183icon-shadow: none; 184} 185@else if $t==undecorated { 186// 187// reset 188// 189color: inherit; 190background-color: transparent; 191border-color: transparent; 192box-shadow: 0 0 transparent; 193text-shadow: none; 194icon-shadow: none; 195} 196} 197 198