_drawing.scss
ASCII text
1// generic drawing of more complex things 2 3@use "../../theme"; 4@use "../../theme-color"; 5@use "../../shadow"; 6 7@mixin entry($t, $fc: theme-color.$primary) { 8// 9// entry 10// 11// $t: entry type 12// $fc: focus color 13// 14 15@if $t == normal { 16transition-duration: theme.$state-duration; 17background-color: if($fc == theme-color.$primary, theme-color.entry-fill(theme-color.$on-surface), theme-color.entry-fill(theme-color.$on-dark)); 18border-color: transparent; 19box-shadow: inset 0 -1px if($fc == theme-color.$primary, theme-color.stroke(theme-color.$on-surface), $fc); 20} 21 22@if $t == focus { 23border-color: transparent; 24box-shadow: inset 0 -2px $fc; 25} 26 27@if $t == hover { 28box-shadow: inset 0 -1px if($fc == theme-color.$primary, theme-color.$on-surface, $fc); 29} 30 31@if $t == insensitive { 32color: theme-color.disabled(theme-color.$on-surface); 33border-color: transparent; 34box-shadow: inset 0 -1px if($fc == theme-color.$primary, theme-color.disabled-stroke(theme-color.$on-surface), $fc); 35} 36} 37 38 39@mixin button($t, $c: theme-color.$surface-z8, $tc: theme-color.$on-surface) { 40// 41// button 42// 43// $t: button type 44// $c: base color 45// $tc: text color 46// 47 48@if $t == normal { 49color: $tc; 50background-color: $c; 51border-color: transparent; 52box-shadow: shadow.$z2; 53text-shadow: none; 54icon-shadow: none; 55transition-duration: theme.$state-duration; 56} 57 58@if $t == focus { 59color: $tc; 60background-color: theme-color.focus-overlay($tc, $on: $c); 61text-shadow: none; 62icon-shadow: none; 63box-shadow: shadow.$z4; 64} 65 66@if $t == hover { 67color: $tc; 68background-color: theme-color.hover-overlay($tc, $on: $c); 69border-color: transparent; 70box-shadow: shadow.$z4; 71text-shadow: none; 72icon-shadow: none; 73} 74 75@if $t == active { 76color: $tc; 77background-color: theme-color.pressed-overlay($tc, $on: $c); 78border-color: transparent; 79box-shadow: shadow.$z8; 80text-shadow: none; 81icon-shadow: none; 82transition-duration: theme.$ripple-duration; 83} 84 85@if $t == insensitive { 86color: if($tc == theme-color.$on-surface, theme-color.disabled(theme-color.$on-surface), $tc); 87background-color: if($c == theme-color.$surface-z8, theme-color.fill(theme-color.$on-surface), $c); 88border-color: transparent; 89box-shadow: shadow.$z0; 90text-shadow: none; 91icon-shadow: none; 92} 93 94@if $t == flat-normal { 95color: if($tc != theme-color.$on-dark, theme-color.$primary, theme-color.hint(theme-color.$on-dark)); 96background-color: transparent; 97border-color: transparent; 98box-shadow: shadow.$z0; 99text-shadow: none; 100icon-shadow: none; 101transition-duration: theme.$state-duration; 102} 103 104@if $t == flat-focus { 105color: if($tc != theme-color.$on-dark, theme-color.$primary, theme-color.hint(theme-color.$on-dark)); 106background-color: theme-color.focus-overlay(if($tc != theme-color.$on-dark, theme-color.$primary, theme-color.$on-dark)); 107text-shadow: none; 108icon-shadow: none; 109box-shadow: shadow.$z0; 110} 111 112@if $t == flat-hover { 113color: if($tc != theme-color.$on-dark, theme-color.$primary, theme-color.hint(theme-color.$on-dark)); 114background-color: theme-color.hover-overlay(if($tc != theme-color.$on-dark, theme-color.$primary, theme-color.$on-dark)); 115border-color: transparent; 116box-shadow: shadow.$z0; 117text-shadow: none; 118icon-shadow: none; 119} 120 121@if $t == flat-active { 122color: if($tc != theme-color.$on-dark, theme-color.$primary, theme-color.hint(theme-color.$on-dark)); 123background-color: theme-color.pressed-overlay(if($tc != theme-color.$on-dark, theme-color.$primary, theme-color.$on-dark)); 124border-color: transparent; 125box-shadow: shadow.$z0; 126text-shadow: none; 127icon-shadow: none; 128transition-duration: theme.$ripple-duration; 129} 130 131@if $t == flat-insensitive { 132color: if($tc != theme-color.$on-dark, theme-color.disabled-hint(theme-color.$on-surface), theme-color.disabled-hint(theme-color.$on-dark)); 133background-color: transparent; 134border-color: transparent; 135box-shadow: shadow.$z0; 136text-shadow: none; 137icon-shadow: none; 138} 139} 140