_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, 46$fill_color, 47$osd_semi_fill_color); 48 49} 50@if $t==focus { 51border-color: transparent; 52box-shadow: inset 0 -2px if($fc==$selected_bg_color, 53$selected_bg_color, 54$osd_indicator_color); 55} 56@if $t==hover { } 57@if $t==insensitive { 58color: $insensitive_fg_color; 59border-color: transparent; 60box-shadow: inset 0 -1px if($fc==$selected_bg_color, 61$semi_fill_color, 62$osd_semi_fill_color); 63} 64} 65 66// buttons 67 68@mixin button($t, $c:$bg_color, $tc:$fg_color) { 69// 70// Button drawing function 71// 72// $t: button type, 73// $c: base button color for colored* types 74// $tc: optional text color for colored* types 75// 76// possible $t values: 77// normal, hover, active, insensitive, undecorated 78// 79@if $t==normal { 80// 81// normal button 82// 83color: if($tc!=$fg_color, $tc, $secondary_fg_color); 84background-color: $c; 85border-color: transparent; 86@include shadow(1); 87text-shadow: none; 88icon-shadow: none; 89} 90@if $t==focus { 91// 92// focused button 93// 94color: $tc; 95text-shadow: none; 96icon-shadow: none; 97box-shadow: 0 0 transparent; 98// box-shadow: inset 0px 0px 0px 2px $fill_color; 99} 100 101@else if $t==hover { 102// 103// hovered button 104// 105color: if($tc!=$fg_color, $tc, $fg_color); 106background-color: $c; 107border-color: transparent; 108@include shadow(2); 109text-shadow: none; 110icon-shadow: none; 111 112} 113@else if $t==active { 114// 115// pushed button 116// 117color: if($tc!=$fg_color, $tc, $fg_color); 118background-color: mix($tc,$c,20%); 119border-color: transparent; 120@include shadow(2); 121text-shadow: none; 122icon-shadow: none; 123} 124@else if $t==insensitive { 125// 126// insensitive button 127// 128color: if($tc!=$fg_color, $insensitive_fg_color, $insensitive_secondary_fg_color); 129background-color: $semi_fill_color; 130border-color: transparent; 131box-shadow: 0 0 transparent; 132text-shadow: none; 133icon-shadow: none; 134} 135@if $t==flat-normal { 136// 137// normal flat button 138// 139color: if($tc!=$fg_color, $tc, $secondary_fg_color); 140background-color: transparent; 141border-color: transparent; 142box-shadow: 0 0 transparent; 143text-shadow: none; 144icon-shadow: none; 145} 146@if $t==flat-focus { 147// 148// focused flat button 149// 150color: $tc; 151text-shadow: none; 152icon-shadow: none; 153box-shadow: 0 0 transparent; 154// box-shadow: inset 0px 0px 0px 2px $fill_color; 155} 156 157@else if $t==flat-hover { 158// 159// hovered flat button 160// 161color: if($tc!=$fg_color, $tc, $fg_color); 162background-color: $semi_fill_color; 163border-color: transparent; 164box-shadow: 0 0 transparent; 165text-shadow: none; 166icon-shadow: none; 167 168} 169@else if $t==flat-active { 170// 171// pushed flat button 172// 173color: if($tc!=$fg_color, $tc, $fg_color); 174background-color: $fill_color; 175border-color: transparent; 176box-shadow: 0 0 transparent; 177text-shadow: none; 178icon-shadow: none; 179} 180@else if $t==flat-insensitive { 181// 182// insensitive flat button 183// 184color: if($tc!=$fg_color, $insensitive_fg_color, $insensitive_secondary_fg_color); 185background-color: transparent; 186border-color: transparent; 187box-shadow: 0 0 transparent; 188text-shadow: none; 189icon-shadow: none; 190} 191@else if $t==undecorated { 192// 193// reset 194// 195color: inherit; 196background-color: transparent; 197border-color: transparent; 198box-shadow: 0 0 transparent; 199text-shadow: none; 200icon-shadow: none; 201} 202} 203 204