_common.scss 103 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385
  1. @function gtkalpha($c,$a) {
  2. @return unquote("alpha(#{$c},#{$a})");
  3. }
  4. $ease-out-quad: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  5. $asset_suffix: if($variant=='dark', '-dark', '');
  6. $backdrop_transition: 200ms ease-out;
  7. $button_transition: all 200ms $ease-out-quad;
  8. * {
  9. padding: 0;
  10. -GtkToolButton-icon-spacing: 4;
  11. -GtkTextView-error-underline-color: $error_color;
  12. // The size for scrollbars. The slider is 2px smaller, but we keep it
  13. // up so that the whole area is sensitive to button presses for the
  14. // slider. The stepper button is larger in both directions, the slider
  15. // only in the width
  16. -GtkScrolledWindow-scrollbar-spacing: 0;
  17. -GtkToolItemGroup-expander-size: 11;
  18. -GtkWidget-text-handle-width: 20;
  19. -GtkWidget-text-handle-height: 24;
  20. -GtkDialog-button-spacing: 4;
  21. -GtkDialog-action-area-border: 0;
  22. // We use the outline properties to signal the focus properties
  23. // to the adwaita engine: using real CSS properties is faster,
  24. // and we don't use any outlines for now.
  25. outline-color: transparentize($fg_color, 0.7);
  26. outline-style: dashed;
  27. outline-offset: -3px;
  28. outline-width: 1px;
  29. -gtk-outline-radius: 2px;
  30. -gtk-secondary-caret-color: $selected_bg_color
  31. }
  32. /***************
  33. * Base States *
  34. ***************/
  35. .background {
  36. color: $fg_color;
  37. background-color: $bg_color;
  38. &:backdrop {
  39. color: $backdrop_fg_color;
  40. background-color: $backdrop_bg_color;
  41. text-shadow: none;
  42. -gtk-icon-shadow: none;
  43. }
  44. }
  45. /*
  46. These wildcard seems unavoidable, need to investigate.
  47. Wildcards are bad and troublesome, use them with care,
  48. or better, just don't.
  49. Everytime a wildcard is used a kitten dies, painfully.
  50. */
  51. *:disabled { -gtk-icon-effect: dim; }
  52. .gtkstyle-fallback {
  53. color: $fg_color;
  54. background-color: $bg_color;
  55. text-shadow: none;
  56. &:hover {
  57. color: $fg_color;
  58. background-color: lighten($bg_color, 10%);
  59. }
  60. &:active {
  61. color: $fg_color;
  62. background-color: darken($bg_color, 10%);
  63. }
  64. &:disabled {
  65. color: $insensitive_fg_color;
  66. background-color: $insensitive_bg_color;
  67. }
  68. &:selected {
  69. color: $selected_fg_color;
  70. background-color: $selected_bg_color;
  71. }
  72. }
  73. .view,
  74. %view {
  75. color: $text_color;
  76. background-color: $base_color;
  77. &:backdrop {
  78. color: $backdrop_text_color;
  79. background-color: $backdrop_base_color;
  80. }
  81. &:selected {
  82. &:focus, & {
  83. @extend %selected_items;
  84. border-radius: 3px;
  85. }
  86. }
  87. }
  88. .view,
  89. textview {
  90. text {
  91. @extend %view;
  92. selection { &:focus, & { @extend %selected_items; }}
  93. }
  94. }
  95. textview border { background-color: mix($bg_color, $base_color, 50%); }
  96. iconview { @extend .view; }
  97. .rubberband,
  98. rubberband {
  99. border: 1px solid darken($selected_bg_color, 10%);
  100. background-color: transparentize(darken($selected_bg_color, 10%), 0.8);
  101. }
  102. flowbox {
  103. rubberband { @extend rubberband; }
  104. flowboxchild {
  105. padding: 3px;
  106. border-radius: 3px;
  107. &:selected {
  108. @extend %selected_items;
  109. outline-offset: -2px;
  110. }
  111. }
  112. }
  113. label {
  114. &.separator {
  115. @extend .dim-label;
  116. color: $fg_color;
  117. &:backdrop { color: $backdrop_fg_color; }
  118. }
  119. row:selected &,
  120. &:selected { @extend %nobg_selected_items; }
  121. selection {
  122. background-color: $selected_bg_color;
  123. color: $selected_fg_color;
  124. }
  125. &:disabled {
  126. color: $insensitive_fg_color;
  127. selection { @extend %selected_items:disabled; }
  128. &:backdrop { color: $backdrop_insensitive_color; }
  129. }
  130. &:backdrop {
  131. color: $backdrop_fg_color;
  132. selection { @extend %selected_items:backdrop; }
  133. }
  134. }
  135. .dim-label {
  136. opacity: 0.55;
  137. text-shadow: none;
  138. }
  139. assistant {
  140. .sidebar {
  141. background-color: $base_color;
  142. border-top: 1px solid $borders_color;
  143. &:backdrop {
  144. background-color: $backdrop_base_color;
  145. border-color: $backdrop_borders_color;
  146. }
  147. }
  148. &.csd .sidebar { border-top-style: none; }
  149. .sidebar label { padding: 6px 12px; }
  150. .sidebar label.highlight { background-color: mix($bg_color, $fg_color, 80%); }
  151. }
  152. %osd, .osd {
  153. color: $osd_fg_color;
  154. border: none;
  155. background-color: $osd_bg_color;
  156. background-clip: padding-box;
  157. outline-color: transparentize($osd_fg_color, 0.7);
  158. text-shadow: 0 1px black;
  159. -gtk-icon-shadow: 0 1px black;
  160. &:backdrop {
  161. color: shade($osd_fg_color, 1.2);
  162. background-color: shade($osd_bg_color, 1.6);
  163. text-shadow: none;
  164. -gtk-icon-shadow: none;
  165. }
  166. }
  167. /*********************
  168. * Spinner Animation *
  169. *********************/
  170. @keyframes spin {
  171. to { -gtk-icon-transform: rotate(1turn); }
  172. }
  173. spinner {
  174. background: none;
  175. opacity: 0; // non spinning spinner makes no sense
  176. -gtk-icon-source: -gtk-icontheme('process-working-symbolic');
  177. &:checked {
  178. opacity: 1;
  179. animation: spin 1s linear infinite;
  180. &:disabled { opacity: 0.5; }
  181. }
  182. }
  183. /****************
  184. * Text Entries *
  185. ****************/
  186. %entry,
  187. entry {
  188. %entry_basic, & {
  189. min-height: 28px;
  190. padding-left: 4px;
  191. padding-right: 4px;
  192. border: 1px solid;
  193. border-radius: 3px;
  194. transition: all 200ms $ease-out-quad;
  195. @include entry(normal);
  196. image { // icons inside the entry
  197. &.left { margin-right: 6px; }
  198. &.right { margin-left: 6px; }
  199. }
  200. undershoot {
  201. &.left { @include undershoot(left); }
  202. &.right { @include undershoot(right); }
  203. }
  204. &.flat {
  205. &:focus, & {
  206. min-height: 0;
  207. padding: 2px;
  208. background-color: transparent;
  209. border-color: transparent;
  210. border-radius: 0;
  211. }
  212. }
  213. &:focus { @include entry(focus); }
  214. &:disabled { @include entry(insensitive); }
  215. &:backdrop {
  216. @include entry(backdrop);
  217. transition: $backdrop_transition;
  218. }
  219. &:backdrop:disabled { @include entry(backdrop-insensitive); }
  220. selection { &:focus, & { @extend %selected_items; }}
  221. // entry error and warning style
  222. @each $e_type, $e_color in (error, $error_color),
  223. (warning, $warning_color) {
  224. &.#{$e_type} {
  225. background-color: transparentize($e_color, 0.9);
  226. color: $e_color;
  227. border-color: entry_focus_border($e_color);
  228. &:focus { @include entry(focus, $e_color); }
  229. selection { background-color: $e_color; }
  230. }
  231. }
  232. image { // entry icons colors
  233. color: mix($fg_color, $base_color, 80%);
  234. &:hover { color: $fg_color; }
  235. &:active { color: $selected_bg_color; }
  236. &:backdrop { color: mix($backdrop_fg_color, $backdrop_base_color, 80%); }
  237. }
  238. &:drop(active) {
  239. &:focus, & {
  240. border-color: $drop_target_color;
  241. box-shadow: inset 0 0 0 1px $drop_target_color;
  242. }
  243. }
  244. .osd & {
  245. @include entry(osd);
  246. &:focus { @include entry(osd-focus); }
  247. &:backdrop { @include entry(osd-backdrop); }
  248. &:disabled { @include entry(osd-insensitive); }
  249. }
  250. }
  251. progress {
  252. margin: 2px -6px;
  253. background-color: transparent;
  254. background-image: none;
  255. border-radius: 0;
  256. border-width: 0 0 2px;
  257. border-color: $selected_bg_color;
  258. border-style: solid;
  259. box-shadow: none;
  260. &:backdrop { background-color: transparent; }
  261. }
  262. // linked entries
  263. .linked:not(.vertical) > & { @extend %linked; }
  264. .linked:not(.vertical) > &:focus + &,
  265. .linked:not(.vertical) > &:focus + button,
  266. .linked:not(.vertical) > &:focus + combobox > box > button.combo { border-left-color: entry_focus_border(); }
  267. .linked:not(.vertical) > &:drop(active) + &,
  268. .linked:not(.vertical) > &:drop(active) + button,
  269. .linked:not(.vertical) > &:drop(active) + combobox > box > button.combo { border-left-color: $drop_target_color; }
  270. // Vertically linked entries
  271. // FIXME: take care of "colored" entries
  272. .linked.vertical > & {
  273. @extend %linked_vertical;
  274. // brighter border between linked entries
  275. &:not(:disabled) + entry:not(:disabled),
  276. &:not(:disabled) + %entry:not(:disabled) {
  277. border-top-color: mix($borders_color, $base_color, 30%);
  278. background-color: $base_color;
  279. &:backdrop {
  280. border-top-color: mix($backdrop_borders_color, $backdrop_base_color, 30%);
  281. background-color: $backdrop_base_color;
  282. }
  283. }
  284. // brighter border between linked insensitive entries
  285. &:disabled + %entry:disabled,
  286. &:disabled + entry:disabled { border-top-color: mix($borders_color, $base_color, 30%); }
  287. // color back the top border of a linked focused entry following another entry and add back the focus shadow.
  288. // :not(:only-child) is a specificity bump hack.
  289. + %entry:focus:not(:only-child),
  290. + entry:focus:not(:only-child) { border-top-color: entry_focus_border(); }
  291. + %entry:drop(active):not(:only-child),
  292. + entry:drop(active):not(:only-child) { border-top-color: $drop_target_color; }
  293. // this takes care of coloring the top border of the focused entry subsequent widget.
  294. // :not(:only-child) is a specificity bump hack.
  295. &:focus:not(:only-child) {
  296. + %entry,
  297. + entry,
  298. + button,
  299. + combobox > box > button.combo { border-top-color: entry_focus_border(); }
  300. }
  301. &:drop(active):not(:only-child) {
  302. + %entry,
  303. + entry,
  304. + button,
  305. + combobox > box > button.combo { border-top-color: $drop_target_color; }
  306. }
  307. }
  308. }
  309. treeview entry {
  310. &:focus {
  311. &:dir(rtl), &:dir(ltr) { // specificity bump hack
  312. background-color: $base_color;
  313. transition-property: color, background;
  314. }
  315. }
  316. &.flat, & {
  317. border-radius: 0;
  318. background-image: none;
  319. background-color: $base_color;
  320. &:focus { border-color: $selected_bg_color; }
  321. }
  322. }
  323. /***********
  324. * Buttons *
  325. ***********/
  326. // stuff for .needs-attention
  327. $_dot_color: if($variant=='light', $selected_bg_color,
  328. lighten($selected_bg_color,15%));
  329. @keyframes needs_attention {
  330. from {
  331. background-image: -gtk-gradient(radial,
  332. center center, 0,
  333. center center, 0.01,
  334. to($_dot_color),
  335. to(transparent));
  336. }
  337. to {
  338. background-image: -gtk-gradient(radial,
  339. center center, 0,
  340. center center, 0.5,
  341. to($selected_bg_color),
  342. to(transparent));
  343. }
  344. }
  345. %button,
  346. button {
  347. @at-root %button_basic, & {
  348. min-height: 24px;
  349. min-width: 16px;
  350. padding: 1px 2px;
  351. border: 1px solid;
  352. border-radius: 3px;
  353. transition: $button_transition;
  354. @include button(normal);
  355. &.flat {
  356. @include button(undecorated);
  357. // to avoid adiacent buttons borders clashing when transitioning, the transition on the normal state is set
  358. // to none, while it's added back in the hover state, so the button decoration will fade in on hover, but
  359. // it won't fade out when the pointer leave the button allocation area. To make the transition more evident
  360. // in this case the duration is increased.
  361. transition: none;
  362. &:hover {
  363. transition: $button_transition;
  364. transition-duration: 500ms;
  365. &:active { transition: $button_transition; }
  366. }
  367. }
  368. &:hover {
  369. @include button(hover);
  370. -gtk-icon-effect: highlight;
  371. }
  372. &:active,
  373. &:checked {
  374. @include button(active);
  375. transition-duration: 50ms;
  376. }
  377. &:backdrop {
  378. &.flat, & {
  379. @include button(backdrop);
  380. transition: $backdrop_transition;
  381. -gtk-icon-effect: none;
  382. &:active,
  383. &:checked { @include button(backdrop-active); }
  384. &:disabled {
  385. @include button(backdrop-insensitive);
  386. &:active,
  387. &:checked { @include button(backdrop-insensitive-active); }
  388. }
  389. }
  390. }
  391. &.flat { &:backdrop, &:disabled, &:backdrop:disabled { @include button(undecorated); }}
  392. &:disabled {
  393. @include button(insensitive);
  394. &:active,
  395. &:checked { @include button(insensitive-active); }
  396. }
  397. &.image-button {
  398. min-width: 24px;
  399. padding-left: 4px;
  400. padding-right: 4px;
  401. }
  402. &.text-button {
  403. padding-left: 8px;
  404. padding-right: 8px;
  405. }
  406. &.text-button.image-button {
  407. padding-left: 4px;
  408. padding-right: 4px;
  409. label {
  410. padding-left: 4px;
  411. padding-right: 4px;
  412. }
  413. }
  414. &:drop(active) {
  415. color: $drop_target_color;
  416. border-color: $drop_target_color;
  417. box-shadow: inset 0 0 0 1px $drop_target_color;
  418. }
  419. }
  420. @at-root %button_selected, & {
  421. row:selected & {
  422. @if $variant == 'light' { border-color: $selected_borders_color; }
  423. &.flat:not(:active):not(:checked):not(:hover):not(disabled) {
  424. color: $selected_fg_color;
  425. border-color: transparent;
  426. &:backdrop { color: if($variant=='light', $backdrop_base_color, $backdrop_fg_color); }
  427. }
  428. }
  429. }
  430. // big standalone buttons like in Documents pager
  431. &.osd {
  432. min-width: 24px;
  433. min-height: 32px;
  434. &.image-button { min-width: 32px; }
  435. color: $osd_fg_color;
  436. border-radius: 5px;
  437. outline-color: transparentize($osd_fg_color, 0.7); //FIXME: define a color var?
  438. @include button(osd);
  439. border: none;
  440. box-shadow: none;
  441. &:hover {
  442. @include button(osd-hover);
  443. border: none;
  444. box-shadow: none;
  445. }
  446. &:active,
  447. &:checked {
  448. @include button(osd-active);
  449. border: none;
  450. box-shadow: none;
  451. }
  452. &:disabled {
  453. &:backdrop, & {
  454. @include button(osd-insensitive);
  455. border: none;
  456. }
  457. }
  458. &:backdrop {
  459. @include button(osd-backdrop);
  460. border: none;
  461. }
  462. }
  463. //overlay / OSD style
  464. @at-root %osd_button,
  465. .osd & {
  466. @include button(osd);
  467. &:hover { @include button(osd-hover); }
  468. &:active,
  469. &:checked { &:backdrop, & { @include button(osd-active); }}
  470. &:disabled { &:backdrop, & { @include button(osd-insensitive); }}
  471. &:backdrop { @include button(osd-backdrop); }
  472. &.flat {
  473. @include button(undecorated);
  474. box-shadow: none; //FIXME respect no edge on the button mixin
  475. text-shadow: 0 1px black;
  476. -gtk-icon-shadow: 0 1px black;
  477. &:hover { @include button(osd-hover); }
  478. &:disabled {
  479. @include button(osd-insensitive);
  480. background-image: none;
  481. border-color: transparent;
  482. box-shadow: none;
  483. }
  484. &:backdrop { @include button(undecorated); }
  485. &:active,
  486. &:checked { @include button(osd-active); }
  487. }
  488. }
  489. // Suggested and Destructive Action buttons
  490. @each $b_type, $b_color in (suggested-action, $selected_bg_color),
  491. (destructive-action, $destructive_color) {
  492. &.#{$b_type} {
  493. @include button(normal, $b_color, white);
  494. &.flat {
  495. @include button(undecorated);
  496. color: $b_color; //FIXME: does it work on the dark variant?
  497. }
  498. &:hover { @include button(hover, $b_color, white); }
  499. &:active,
  500. &:checked { @include button(active, $b_color, white); }
  501. &:backdrop,
  502. &.flat:backdrop {
  503. @include button(backdrop, $b_color, white);
  504. &:active,
  505. &:checked { @include button(backdrop-active, $b_color, white); }
  506. &:disabled {
  507. @include button(backdrop-insensitive);
  508. &:active,
  509. &:checked { @include button(backdrop-insensitive-active, $b_color, white); }
  510. }
  511. }
  512. &.flat {
  513. &:backdrop, &:disabled, &:backdrop:disabled {
  514. @include button(undecorated);
  515. color: transparentize($b_color, 0.2);
  516. }
  517. }
  518. &:disabled {
  519. @include button(insensitive, $b_color, white);
  520. &:active,
  521. &:checked { @include button(insensitive-active, $b_color, white); }
  522. }
  523. .osd & {
  524. @include button(osd, $b_color);
  525. &:hover { @include button(osd-hover, $b_color); }
  526. &:active,
  527. &:checked { &:backdrop, & { @include button(osd-active, $b_color); }}
  528. &:disabled { &:backdrop, & { @include button(osd-insensitive, $b_color); }}
  529. &:backdrop { @include button(osd-backdrop, $b_color); }
  530. }
  531. }
  532. }
  533. .stack-switcher > & {
  534. // to position the needs attention dot, padding is added to the button
  535. // child, a label needs just lateral padding while an icon needs vertical
  536. // padding added too.
  537. outline-offset: -3px; // needs to be set or it gets overriden by GtkRadioButton outline-offset
  538. > label {
  539. padding-left: 6px; // label padding
  540. padding-right: 6px; //
  541. }
  542. > image {
  543. padding-left: 6px; // image padding
  544. padding-right: 6px; //
  545. padding-top: 3px; //
  546. padding-bottom: 3px; //
  547. }
  548. &.text-button {
  549. // compensate text-button paddings
  550. padding-left: 10px;
  551. padding-right: 10px;
  552. }
  553. &.image-button {
  554. // we want image buttons to have a 1:1 aspect ratio, so compensation
  555. // of the padding added to the GtkImage is needed
  556. padding-left: 2px;
  557. padding-right: 2px;
  558. }
  559. &.needs-attention {
  560. > label,
  561. > image { @extend %needs_attention; }
  562. &:active,
  563. &:checked {
  564. > label,
  565. > image {
  566. animation: none;
  567. background-image: none;
  568. }
  569. }
  570. }
  571. }
  572. //inline-toolbar buttons
  573. .inline-toolbar &, .inline-toolbar &:backdrop {
  574. border-radius: 2px;
  575. border-width: 1px;
  576. @extend %linked;
  577. }
  578. .primary-toolbar & { -gtk-icon-shadow: none; } // tango icons don't need shadows
  579. .linked > &,
  580. .linked > &:hover,
  581. .linked > &:active,
  582. .linked > &:checked,
  583. .linked > &:backdrop { @extend %linked; }
  584. .linked.vertical > &,
  585. .linked.vertical > &:hover,
  586. .linked.vertical > &:active,
  587. .linked.vertical > &:checked,
  588. .linked.vertical > &:backdrop { @extend %linked_vertical; }
  589. }
  590. %needs_attention {
  591. animation: needs_attention 150ms ease-in;
  592. $_dot_shadow: _text_shadow_color();
  593. $_dot_shadow_r: if($variant=='light',0.5,0.45);
  594. background-image: -gtk-gradient(radial,
  595. center center, 0,
  596. center center, 0.5,
  597. to($_dot_color),
  598. to(transparent)),
  599. -gtk-gradient(radial,
  600. center center, 0,
  601. center center, $_dot_shadow_r,
  602. to($_dot_shadow),
  603. to(transparent));
  604. background-size: 6px 6px, 6px 6px;
  605. background-repeat: no-repeat;
  606. @if $variant == 'light' { background-position: right 3px, right 4px; }
  607. @else { background-position: right 3px, right 2px; }
  608. &:backdrop { background-size: 6px 6px, 0 0;}
  609. &:dir(rtl) {
  610. @if $variant == 'light' { background-position: left 3px, left 4px; }
  611. @else { background-position: left 3px, left 2px; }
  612. }
  613. }
  614. // all the following is for the +|- buttons on inline toolbars, that way
  615. // should really be deprecated...
  616. .inline-toolbar toolbutton > button { // redefining the button look is
  617. // needed since those are flat...
  618. @include button(normal);
  619. &:hover { @include button(hover); }
  620. &:active,
  621. &:checked{ @include button(active); }
  622. &:disabled {
  623. @include button(insensitive);
  624. &:active,
  625. &:checked { @include button(insensitive-active); }
  626. }
  627. &:backdrop {
  628. @include button(backdrop);
  629. &:active,
  630. &:checked { @include button(backdrop-active); }
  631. &:disabled {
  632. @include button(backdrop-insensitive);
  633. &:active,
  634. &:checked { @include button(backdrop-insensitive-active); }
  635. }
  636. }
  637. }
  638. // More inline toolbar buttons
  639. toolbar.inline-toolbar toolbutton,
  640. toolbar.inline-toolbar toolbutton:backdrop {
  641. > button.flat { @extend %linked_middle; }
  642. &:first-child > button.flat { @extend %linked:first-child; }
  643. &:last-child > button.flat { @extend %linked:last-child; }
  644. &:only-child > button.flat { @extend %linked:only-child; }
  645. }
  646. %linked_middle {
  647. border-radius: 0;
  648. border-right-style: none;
  649. }
  650. %linked {
  651. @extend %linked_middle;
  652. &:first-child {
  653. border-top-left-radius: 3px;
  654. border-bottom-left-radius: 3px;
  655. }
  656. &:last-child {
  657. border-top-right-radius: 3px;
  658. border-bottom-right-radius: 3px;
  659. border-right-style: solid;
  660. }
  661. &:only-child {
  662. border-radius: 3px;
  663. border-style: solid;
  664. }
  665. }
  666. %linked_vertical_middle {
  667. border-style: solid solid none solid;
  668. border-radius: 0;
  669. }
  670. %linked_vertical{
  671. @extend %linked_vertical_middle;
  672. &:first-child {
  673. border-top-left-radius: 3px;
  674. border-top-right-radius: 3px;
  675. }
  676. &:last-child {
  677. border-bottom-left-radius: 3px;
  678. border-bottom-right-radius: 3px;
  679. border-style: solid;
  680. }
  681. &:only-child {
  682. border-radius: 3px;
  683. border-style: solid;
  684. }
  685. }
  686. %undecorated_button {
  687. background-color: transparent;
  688. background-image: none;
  689. border-color: transparent;
  690. box-shadow: inset 0 1px transparentize(white, 1),
  691. 0 1px transparentize(white, 1);
  692. text-shadow: none;
  693. -gtk-icon-shadow: none;
  694. }
  695. /* menu buttons */
  696. modelbutton.flat,
  697. .menuitem.button.flat {
  698. min-height: 26px;
  699. padding-left: 5px;
  700. padding-right: 5px;
  701. border-radius: 3px;
  702. outline-offset: -2px;
  703. @extend %undecorated_button;
  704. &:hover { background-color: $popover_hover_color; }
  705. &:selected { @extend %selected_items; }
  706. &:backdrop,
  707. &:backdrop:hover { @extend %undecorated_button; }
  708. // FIXME: remove the following when the checks/radios rewrite lands
  709. check:last-child,
  710. radio:last-child { margin-left: 8px; }
  711. check:first-child,
  712. radio:first-child { margin-right: 8px; }
  713. }
  714. modelbutton.flat arrow {
  715. background: none;
  716. &:hover { background: none; }
  717. &.left { -gtk-icon-source: -gtk-icontheme("pan-start-symbolic"); }
  718. &.right { -gtk-icon-source: -gtk-icontheme("pan-end-symbolic"); }
  719. }
  720. button.color {
  721. padding: 4px;
  722. colorswatch:only-child {
  723. &, overlay { border-radius: 0; }
  724. @if $variant == 'light' {
  725. box-shadow: 0 1px _text_shadow_color();
  726. &:disabled,
  727. &:backdrop,
  728. &:active,
  729. &:checked { colorswatch:only-child { box-shadow: none; }}
  730. }
  731. }
  732. }
  733. /*********
  734. * Links *
  735. *********/
  736. *:link {
  737. color: $link_color;
  738. &:visited {
  739. color: $link_visited_color;
  740. *:selected & { color: mix($selected_fg_color, $selected_bg_color, 60%); }
  741. }
  742. &:hover {
  743. color: lighten($link_color,10%);
  744. *:selected & { color: mix($selected_fg_color, $selected_bg_color, 90%); }
  745. }
  746. &:active {
  747. color: $link_color;
  748. *:selected & { color: mix($selected_fg_color, $selected_bg_color, 80%); }
  749. }
  750. &:backdrop { &:backdrop:hover, &:backdrop:hover:selected, & { color: $selected_bg_color; }}
  751. @at-root %link_selected,
  752. &:selected,
  753. *:selected & { color: mix($selected_fg_color, $selected_bg_color, 80%); }
  754. }
  755. button:link,
  756. button:visited {
  757. @extend %undecorated_button;
  758. @extend *:link;
  759. text-shadow: none;
  760. &:hover,
  761. &:active,
  762. &:checked {
  763. @extend %undecorated_button;
  764. text-shadow: none;
  765. }
  766. > label { text-decoration-line: underline; }
  767. }
  768. /*****************
  769. * GtkSpinButton *
  770. *****************/
  771. spinbutton {
  772. &:not(.vertical) {
  773. // in this horizontal configuration, the whole spinbutton
  774. // behaves as the entry, so we extend the entry styling
  775. // and nuke the style on the internal entry
  776. @extend %entry;
  777. padding: 0;
  778. entry {
  779. min-width: 28px;
  780. // reset all the other props since the spinbutton node is styled here
  781. margin: 0;
  782. background: none;
  783. background-color: transparent;
  784. border: none;
  785. border-radius: 0;
  786. box-shadow: none;
  787. }
  788. button {
  789. min-height: 16px;
  790. margin: 0;
  791. padding-bottom: 0;
  792. padding-top: 0;
  793. color: mix($fg_color, $base_color, 90%);
  794. background-image: none;
  795. border-style: none none none solid;
  796. border-color: transparentize($borders_color, 0.7);
  797. border-radius: 0;
  798. box-shadow: none;
  799. &:dir(rtl) { border-style: none solid none none; }
  800. &:hover {
  801. color: $fg_color;
  802. background-color: $base_hover_color;
  803. }
  804. &:disabled {
  805. color: transparentize($insensitive_fg_color, 0.7);
  806. background-color: transparent;
  807. }
  808. &:active {
  809. background-color: transparentize(black, 0.9);
  810. box-shadow: inset 0 2px 3px -1px transparentize(black, 0.8);
  811. }
  812. &:backdrop {
  813. color: mix($backdrop_fg_color, $backdrop_base_color, 90%);
  814. background-color: transparent;
  815. border-color: transparentize($backdrop_borders_color, 0.7);
  816. transition: $backdrop_transition;
  817. }
  818. &:backdrop:disabled {
  819. color: transparentize($backdrop_insensitive_color,0.7);
  820. background-color: transparent;
  821. border-style: none none none solid; // It is needed or it gets overridden
  822. &:dir(rtl) { border-style: none solid none none; }
  823. }
  824. }
  825. }
  826. // OSD horizontal
  827. .osd &:not(.vertical) {
  828. button {
  829. @include button(undecorated);
  830. color: $osd_fg_color;
  831. border-style: none none none solid;
  832. border-color: transparentize($osd_borders_color, 0.3);
  833. border-radius: 0;
  834. box-shadow: none;
  835. -gtk-icon-shadow: 0 1px black;
  836. &:dir(rtl) { border-style: none solid none none; }
  837. &:hover {
  838. @include button(undecorated);
  839. color: $osd_fg_color;
  840. border-color: transparentize(opacify($osd_borders_color, 1), 0.5);
  841. background-color: transparentize($osd_fg_color, 0.9);
  842. -gtk-icon-shadow: 0 1px black;
  843. box-shadow: none;
  844. }
  845. &:backdrop {
  846. @include button(undecorated);
  847. color: $osd_fg_color;
  848. border-color: transparentize(opacify($osd_borders_color, 1), 0.5);
  849. -gtk-icon-shadow: none;
  850. box-shadow: none;
  851. }
  852. &:disabled {
  853. @include button(undecorated);
  854. color: $osd_insensitive_fg_color;
  855. border-color: transparentize(opacify($osd_borders_color, 1), 0.5);
  856. -gtk-icon-shadow: none;
  857. box-shadow: none;
  858. }
  859. &:dir(ltr):last-child { border-radius: 0 3px 3px 0; }
  860. &:dir(rtl):first-child { border-radius: 3px 0 0 3px; }
  861. }
  862. }
  863. // Vertical
  864. &.vertical {
  865. // in the vertical configuration, we treat the spinbutton
  866. // as a box, and tweak the style of the entry in the middle
  867. // so that it's linked
  868. // FIXME: this should not be set at all, but otherwise it gets the wrong
  869. // color
  870. &:disabled { color: $insensitive_fg_color; }
  871. &:backdrop:disabled { color: $backdrop_insensitive_color; }
  872. &:drop(active) {
  873. border-color: transparent;
  874. box-shadow: none;
  875. }
  876. entry {
  877. min-height: 32px;
  878. min-width: 32px;
  879. padding: 0;
  880. border-radius: 0;
  881. }
  882. button {
  883. min-height: 32px;
  884. min-width: 32px;
  885. padding: 0;
  886. &.up { @extend %top_button; }
  887. &.down { @extend %bottom_button; }
  888. }
  889. %top_button {
  890. border-radius: 3px 3px 0 0;
  891. border-style: solid solid none solid;
  892. }
  893. %bottom_button {
  894. border-radius: 0 0 3px 3px;
  895. border-style: none solid solid solid;
  896. }
  897. }
  898. // OSD vertical
  899. .osd &.vertical button:first-child {
  900. @include button(osd);
  901. &:hover { @include button(osd-hover);}
  902. &:active { @include button(osd-active); }
  903. &:disabled { @include button(osd-insensitive); }
  904. &:backdrop { @include button(osd-backdrop); }
  905. }
  906. // Misc
  907. treeview &:not(.vertical) {
  908. min-height: 0;
  909. border-style: none;
  910. border-radius: 0;
  911. entry {
  912. min-height: 0;
  913. padding: 1px 2px;
  914. }
  915. }
  916. }
  917. /**************
  918. * ComboBoxes *
  919. **************/
  920. combobox {
  921. arrow {
  922. -gtk-icon-source: -gtk-icontheme('pan-down-symbolic');
  923. min-height: 16px;
  924. min-width: 16px;
  925. }
  926. &.linked {
  927. button:nth-child(2) {
  928. &:dir(ltr) { @extend %linked:last-child; }
  929. &:dir(rtl) { @extend %linked:first-child; }
  930. }
  931. }
  932. &:drop(active) { // FIXME: untested
  933. box-shadow: none;
  934. button.combo { @extend %button_basic:drop(active); }
  935. }
  936. }
  937. .linked > combobox > box > button.combo {
  938. // the combo is a composite widget so the way we do button linking doesn't
  939. // work, special case needed. See
  940. // https://bugzilla.gnome.org/show_bug.cgi?id=733979
  941. &:dir(ltr),
  942. &:dir(rtl) { @extend %linked_middle; } // specificity bump
  943. }
  944. .linked:not(.vertical) > combobox:first-child > box > button.combo { @extend %linked:first-child; }
  945. .linked:not(.vertical) > combobox:last-child > box > button.combo { @extend %linked:last-child; }
  946. .linked:not(.vertical) > combobox:only-child > box > button.combo { @extend %linked:only-child; }
  947. .linked.vertical > combobox > box > button.combo { @extend %linked_vertical_middle; }
  948. .linked.vertical > combobox:first-child > box > button.combo { @extend %linked_vertical:first-child;}
  949. .linked.vertical > combobox:last-child > box > button.combo { @extend %linked_vertical:last-child; }
  950. .linked.vertical > combobox:only-child > box > button.combo { @extend %linked_vertical:only-child; }
  951. /************
  952. * Toolbars *
  953. ************/
  954. %toolbar {
  955. -GtkWidget-window-dragging: true;
  956. padding: 4px;
  957. background-color: $bg_color;
  958. }
  959. toolbar {
  960. @extend %toolbar;
  961. @include headerbar_fill;
  962. box-shadow: none;
  963. border-bottom:1px solid $borders_color;
  964. padding: 4px 3px 3px 4px;
  965. // on OSD
  966. .osd & { background-color: transparent; }
  967. // stand-alone OSD toolbars
  968. &.osd {
  969. padding: 13px;
  970. border: none;
  971. border-radius: 5px;
  972. background-color: $osd_bg_color;
  973. &.left,
  974. &.right,
  975. &.top,
  976. &.bottom { border-radius: 0; } // positional classes for `attached` osd toolbars
  977. }
  978. // toolbar separators
  979. &.horizontal separator { margin: 0 7px 1px 6px; }
  980. &.vertical separator { margin: 6px 1px 7px 0; }
  981. &:not(.inline-toolbar):not(.osd) {
  982. switch,
  983. scale,
  984. entry,
  985. spinbutton,
  986. button {
  987. margin-right: 1px;
  988. margin-bottom: 1px;
  989. }
  990. }
  991. }
  992. //searchbar, location-bar & inline-toolbar
  993. .inline-toolbar {
  994. @extend %toolbar;
  995. @extend %darkbar;
  996. padding: 3px;
  997. border-width: 0 1px 1px;
  998. border-radius: 0 0 5px 5px;
  999. }
  1000. searchbar,
  1001. .location-bar {
  1002. @extend %toolbar;
  1003. @extend %darkbar;
  1004. border-width: 0 0 1px;
  1005. padding: 3px;
  1006. }
  1007. %darkbar {
  1008. border-style: solid;
  1009. border-color: $borders_color;
  1010. $_bg: mix($bg_color, $borders_color, 70%);
  1011. background-color: $_bg;
  1012. &:backdrop {
  1013. border-color: $backdrop_borders_color;
  1014. background-color: $backdrop_dark_fill;
  1015. box-shadow: none;
  1016. transition: $backdrop_transition;
  1017. }
  1018. }
  1019. /***************
  1020. * Header bars *
  1021. ***************/
  1022. %titlebar,
  1023. headerbar {
  1024. padding: 0 5px;
  1025. min-height: 38px;
  1026. border-width: 0 0 1px;
  1027. border-style: solid;
  1028. border-color: $borders_color;
  1029. border-radius: 0;
  1030. @include headerbar_fill;
  1031. &:backdrop {
  1032. border-color: $backdrop_borders_color;
  1033. background-color: $bg_color;
  1034. background-image: none;
  1035. box-shadow: inset 0 1px $top_hilight;
  1036. transition: $backdrop_transition;
  1037. }
  1038. .title {
  1039. font-weight: bold;
  1040. padding-left: 12px;
  1041. padding-right: 12px;
  1042. }
  1043. .subtitle {
  1044. font-size: smaller;
  1045. padding-left: 12px;
  1046. padding-right: 12px;
  1047. @extend .dim-label;
  1048. }
  1049. &.selection-mode {
  1050. $_hc: mix($top_hilight,$selected_bg_color, 50%); // hilight color
  1051. color: $selected_fg_color;
  1052. text-shadow: none;
  1053. border-color: $selected_borders_color;
  1054. @include headerbar_fill($selected_bg_color, $_hc);
  1055. &:backdrop {
  1056. background-color: $selected_bg_color;
  1057. background-image: none;
  1058. box-shadow: inset 0 1px mix($top_hilight, $selected_bg_color, 60%);
  1059. }
  1060. .subtitle:link { @extend *:link:selected; }
  1061. button {
  1062. @include button(normal, $selected_bg_color, $selected_fg_color);
  1063. &.flat { @include button(undecorated); }
  1064. &:hover { @include button(hover, $selected_bg_color, $selected_fg_color); }
  1065. &:active,
  1066. &:checked { @include button(active, $selected_bg_color, $selected_fg_color); }
  1067. &:backdrop {
  1068. &.flat, & {
  1069. @include button(backdrop, $selected_bg_color, $selected_fg_color);
  1070. -gtk-icon-effect: none;
  1071. border-color: $selected_borders_color;
  1072. &:active,
  1073. &:checked {
  1074. @include button(backdrop-active, $selected_bg_color, $selected_fg_color);
  1075. border-color: $selected_borders_color;
  1076. }
  1077. &:disabled {
  1078. @include button(backdrop-insensitive, $selected_bg_color, $selected_fg_color);
  1079. border-color: $selected_borders_color;
  1080. &:active, &:checked {
  1081. @include button(backdrop-insensitive-active, $selected_bg_color, $selected_fg_color);
  1082. border-color: $selected_borders_color;
  1083. }
  1084. }
  1085. }
  1086. }
  1087. &.flat { &:backdrop, &:disabled, &:backdrop:disabled { @include button(undecorated); }}
  1088. &:disabled {
  1089. @include button(insensitive, $selected_bg_color, $selected_fg_color);
  1090. &:active,
  1091. &:checked { @include button(insensitive-active, $selected_bg_color, $selected_fg_color); }
  1092. }
  1093. &.suggested-action {
  1094. @include button(normal);
  1095. color: $selected_fg_color;
  1096. border-color: $selected_borders_color;
  1097. &:hover {
  1098. @include button(hover);
  1099. border-color: $selected_borders_color;
  1100. }
  1101. &:active {
  1102. @include button(active);
  1103. border-color: $selected_borders_color;
  1104. }
  1105. &:disabled {
  1106. @include button(insensitive);
  1107. background-image: none;
  1108. background: $bg_color;
  1109. border-color: $selected_borders_color;
  1110. }
  1111. &:backdrop {
  1112. @include button(backdrop);
  1113. border-color: $selected_borders_color;
  1114. }
  1115. &:backdrop:disabled {
  1116. @include button(backdrop-insensitive);
  1117. border-color: $selected_borders_color;
  1118. }
  1119. }
  1120. }
  1121. .selection-menu {
  1122. &:backdrop, & {
  1123. border-color: transparentize($selected_bg_color, 1);
  1124. background-color: transparentize($selected_bg_color, 1);
  1125. background-image: none;
  1126. box-shadow: none;
  1127. padding-left: 10px;
  1128. padding-right: 10px;
  1129. GtkArrow { -GtkArrow-arrow-scaling: 1; }
  1130. .arrow {
  1131. -gtk-icon-source: -gtk-icontheme('pan-down-symbolic');
  1132. color: transparentize($selected_fg_color,0.5);
  1133. -gtk-icon-shadow: none;
  1134. }
  1135. }
  1136. }
  1137. }
  1138. .tiled &,
  1139. .maximized & { &:backdrop, & { border-radius: 0; }} // squared corners when the window is maximized or tiled
  1140. &.default-decoration {
  1141. padding: 4px;
  1142. min-height: 28px;
  1143. button.titlebutton {
  1144. min-height: 26px;
  1145. min-width: 26px;
  1146. margin: 0;
  1147. padding: 0;
  1148. }
  1149. }
  1150. .solid-csd & {
  1151. &:backdrop, & {
  1152. &:dir(rtl), &:dir(ltr) { // specificity bump
  1153. margin-left: -1px;
  1154. margin-right: -1px;
  1155. margin-top: -1px;
  1156. border-radius: 0;
  1157. box-shadow: none;
  1158. }
  1159. }
  1160. }
  1161. }
  1162. headerbar {
  1163. // add vertical margins to common widget on the headerbar to avoid them spanning the whole height
  1164. entry,
  1165. spinbutton,
  1166. separator,
  1167. button {
  1168. margin-top: 3px;
  1169. margin-bottom: 3px;
  1170. }
  1171. button.titlebutton image {
  1172. min-width: 22px;
  1173. min-height: 22px;
  1174. }
  1175. button:not(.image-button):not(.titlebutton) image {
  1176. min-width: 28px;
  1177. min-height: 28px;
  1178. }
  1179. button.image-button {
  1180. min-width: 28px;
  1181. min-height: 28px;
  1182. padding-left: 2px;
  1183. padding-right: 2px;
  1184. }
  1185. switch {
  1186. margin-top: 9px;
  1187. margin-bottom: 9px;
  1188. }
  1189. }
  1190. .background:not(.tiled):not(.maximized) .titlebar {
  1191. &:backdrop, & {
  1192. border-top-left-radius: 7px;
  1193. border-top-right-radius: 7px;
  1194. }
  1195. }
  1196. headerbar {
  1197. window:not(.tiled):not(.maximized) separator:first-child + &, // tackles the paned container case
  1198. window:not(.tiled):not(.maximized) &:first-child { &:backdrop, & { border-top-left-radius: 7px; }}
  1199. window:not(.tiled):not(.maximized) &:last-child { &:backdrop, & { border-top-right-radius: 7px; }}
  1200. }
  1201. .titlebar:not(headerbar) {
  1202. window.csd > & {
  1203. // in csd we assume every titlebar is a headerbar so reset anything, this is needed for split toolbars cases
  1204. padding: 0;
  1205. background-color: transparent;
  1206. background-image: none;
  1207. border-style: none;
  1208. border-color: transparent;
  1209. box-shadow: none;
  1210. }
  1211. > separator { background-color: $borders_color; }
  1212. @extend %titlebar;
  1213. }
  1214. // Fixes: https://github.com/shimmerproject/Greybird/issues/157
  1215. // workaround for ugly Ubuntu-related CSD patches
  1216. .background:not(.csd):not(.ssd):not(.solid-csd) headerbar {
  1217. &, &:backdrop {
  1218. &, &:not(:last-child) {
  1219. border-radius: 0;
  1220. border-top-color: transparent;
  1221. box-shadow: none;
  1222. }
  1223. }
  1224. }
  1225. /************
  1226. * Pathbars *
  1227. ************/
  1228. .path-bar button {
  1229. &.text-button, &.image-button, & {
  1230. padding-left: 4px;
  1231. padding-right: 4px;
  1232. }
  1233. &.text-button.image-button label {
  1234. padding-left: 0;
  1235. padding-right: 0;
  1236. }
  1237. &.text-button.image-button, & {
  1238. label:last-child { padding-right: 8px; }
  1239. label:first-child { padding-left: 8px; }
  1240. }
  1241. image {
  1242. padding-left: 4px;
  1243. padding-right: 4px;
  1244. }
  1245. &.slider-button {
  1246. padding-left: 0;
  1247. padding-right: 0;
  1248. }
  1249. }
  1250. /**************
  1251. * Tree Views *
  1252. **************/
  1253. treeview.view {
  1254. @at-root * {
  1255. -GtkTreeView-horizontal-separator: 4;
  1256. -GtkTreeView-grid-line-width: 1;
  1257. -GtkTreeView-grid-line-pattern: '';
  1258. -GtkTreeView-tree-line-width: 1;
  1259. -GtkTreeView-tree-line-pattern: '';
  1260. -GtkTreeView-expander-size: 16;
  1261. }
  1262. border-left-color: mix($fg_color, $base_color, 50%); // this is actually the tree lines color,
  1263. border-top-color: $bg_color; // while this is the grid lines color, better then nothing
  1264. rubberband { @extend rubberband; } // to avoid borders being overridden by the previously set props
  1265. &:selected {
  1266. &:focus, & {
  1267. border-radius: 0;
  1268. @extend %selected_items;
  1269. }
  1270. &:backdrop, & {
  1271. border-left-color: mix($selected_fg_color, $selected_bg_color, 50%);
  1272. border-top-color: transparentize($fg_color, 0.9); // doesn't work unfortunatelly
  1273. }
  1274. }
  1275. &:disabled {
  1276. color: $insensitive_fg_color;
  1277. &:selected {
  1278. color: mix($selected_fg_color, $selected_bg_color, 40%);
  1279. &:backdrop { color: mix($backdrop_selected_fg_color, $selected_bg_color, 30%); }
  1280. }
  1281. &:backdrop { color: $backdrop_insensitive_color; }
  1282. }
  1283. &.separator {
  1284. min-height: 2px;
  1285. color: $bg_color;
  1286. &:backdrop { color: transparentize($bg_color, 0.9); }
  1287. }
  1288. &:backdrop {
  1289. border-left-color: mix($backdrop_fg_color, $backdrop_bg_color, 50%);
  1290. border-top: $backdrop_bg_color;
  1291. }
  1292. &:drop(active) {
  1293. border-style: solid none;
  1294. border-width: 1px;
  1295. border-color: $selected_borders_color;
  1296. &.after { border-top-style: none; }
  1297. &.before { border-bottom-style: none; }
  1298. }
  1299. &.expander {
  1300. -gtk-icon-source: -gtk-icontheme('pan-end-symbolic');
  1301. &:dir(rtl) { -gtk-icon-source: -gtk-icontheme('pan-end-symbolic-rtl'); }
  1302. color: mix($fg_color, $base_color, 70%);
  1303. &:hover { color: $fg_color; }
  1304. &:selected {
  1305. color: mix($selected_fg_color, $selected_bg_color, 70%);
  1306. &:hover { color: $selected_fg_color; }
  1307. &:backdrop { color: mix($backdrop_selected_fg_color, $selected_bg_color, 70%); }
  1308. }
  1309. &:checked { -gtk-icon-source: -gtk-icontheme('pan-down-symbolic'); }
  1310. &:backdrop { color: mix($backdrop_fg_color, $backdrop_base_color, 70%); }
  1311. }
  1312. &.progressbar { // progress bar in treeviews
  1313. @if $variant == light { color: $base_color; }
  1314. border: 1px solid $selected_borders_color;
  1315. border-radius: 4px;
  1316. background-color: $selected_bg_color;
  1317. background-image: linear-gradient(to bottom,
  1318. $selected_bg_color,
  1319. darken($selected_bg_color, 10%));
  1320. box-shadow: inset 0 1px if($variant=='light', transparentize(white, 0.7),
  1321. transparentize(white, 0.85)),
  1322. 0 1px if($variant=='light', transparentize(black, 0.8),
  1323. transparentize(black, 0.9));
  1324. &:selected {
  1325. &:focus, & {
  1326. border-radius: 4px;
  1327. @if $variant == 'light' {
  1328. color: $selected_bg_color;
  1329. box-shadow: none;
  1330. }
  1331. @else { box-shadow: inset 0 1px transparentize(white, 0.95); }
  1332. background-image: linear-gradient(to bottom,
  1333. $base_color,
  1334. darken($base_color, 10%));
  1335. &:backdrop {
  1336. @if $variant == 'light' {
  1337. color: $selected_bg_color;
  1338. border-color: $selected_borders_color; // otherwise it gets inherited by .view(?!?)
  1339. }
  1340. @else { border-color: $backdrop_base_color; }
  1341. background-color: $backdrop_base_color;
  1342. }
  1343. }
  1344. }
  1345. &:backdrop {
  1346. @if $variant == 'light' { color: $backdrop_base_color; }
  1347. @else { border-color: $backdrop_base_color; }
  1348. background-image: none;
  1349. box-shadow: none;
  1350. }
  1351. }
  1352. &.trough { // progress bar trough in treeviews
  1353. background-color: transparentize($fg_color,0.9);
  1354. border-radius: 4px;
  1355. &:selected {
  1356. &:focus, & {
  1357. background-color: if($variant == 'light',
  1358. transparentize($selected_fg_color, 0.7),
  1359. darken($selected_bg_color, 10%));
  1360. border-radius: 4px;
  1361. @if $variant == 'light' {
  1362. border-width: 1px 0;
  1363. border-style: solid;
  1364. border-color: $selected_bg_color;
  1365. }
  1366. }
  1367. }
  1368. }
  1369. header {
  1370. button {
  1371. $_column_header_color: mix($fg_color, $base_color, 50%);
  1372. @extend %column_header_button;
  1373. color: $_column_header_color;
  1374. background-color: $base_color;
  1375. font-weight: bold;
  1376. text-shadow: none;
  1377. box-shadow: none;
  1378. &:hover {
  1379. @extend %column_header_button;
  1380. color: mix($_column_header_color, $fg_color, 50%);
  1381. box-shadow: none;
  1382. transition: none; //I shouldn't need this
  1383. }
  1384. &:active {
  1385. @extend %column_header_button;
  1386. color: $fg_color;
  1387. transition: none; //I shouldn't need this
  1388. }
  1389. }
  1390. button:last-child { &:backdrop, & { border-right-style: none; }}
  1391. }
  1392. button.dnd,
  1393. header.button.dnd { // for treeview-like derive widgets
  1394. &:active, &:selected, &:hover, & {
  1395. padding: 0 6px;
  1396. transition: none;
  1397. background-image: none;
  1398. background-color: $selected_bg_color;
  1399. color: $base_color;
  1400. border-radius: 0;
  1401. border-style: none;
  1402. box-shadow: inset 0 0 0 1px $base_color;
  1403. text-shadow: none;
  1404. }
  1405. }
  1406. acceleditor > label { background-color: $selected_bg_color; } // see tests/testaccel to test
  1407. }
  1408. %column_header_button {
  1409. padding: 0 6px;
  1410. border-radius: 0;
  1411. background-image: none;
  1412. text-shadow: none;
  1413. border-style: none solid solid none;
  1414. border-color: $bg_color;
  1415. &:disabled {
  1416. border-color: $bg_color;
  1417. background-image: none;
  1418. }
  1419. &:backdrop {
  1420. border-color: $backdrop_bg_color;
  1421. border-style: none solid solid none;
  1422. color: mix($backdrop_fg_color, $backdrop_bg_color, 50%);
  1423. background-image: none;
  1424. background-color: $backdrop_base_color;
  1425. &:disabled {
  1426. border-color: $backdrop_bg_color;
  1427. background-image: none;
  1428. }
  1429. }
  1430. }
  1431. /*********
  1432. * Menus *
  1433. *********/
  1434. menubar,
  1435. .menubar {
  1436. -GtkWidget-window-dragging: true;
  1437. padding: 0px;
  1438. &:backdrop { background-color: $backdrop_bg_color; }
  1439. > menuitem {
  1440. min-height: 16px;
  1441. padding: 3px 8px;
  1442. border: 1px solid transparent;
  1443. &:hover { //Seems like it :hover even with keyboard focus
  1444. background-image: linear-gradient(to bottom,
  1445. shade($selected_bg_color, 1.2),
  1446. shade($selected_bg_color, 1.0)
  1447. );
  1448. color: $selected_fg_color;
  1449. border-color: shade($selected_bg_color, 1.1);
  1450. }
  1451. &:disabled {
  1452. color: $insensitive_fg_color;
  1453. box-shadow: none;
  1454. }
  1455. }
  1456. }
  1457. menu,
  1458. .menu,
  1459. .context-menu {
  1460. margin: 4px;
  1461. padding: 2px 0px;
  1462. background-color: $menu_color;
  1463. border: 1px solid $borders_color; // adds borders in a non composited env
  1464. .csd & { border: none; } // axes borders in a composited env
  1465. &:backdrop { background-color: $backdrop_menu_color; }
  1466. menuitem {
  1467. min-height: 16px;
  1468. min-width: 40px;
  1469. padding: 4px 6px;
  1470. text-shadow: none;
  1471. &:hover {
  1472. color: $selected_fg_color;
  1473. background-image: linear-gradient(to bottom, shade($selected_bg_color, 1.2), shade($selected_bg_color, 1.0));
  1474. box-shadow: inset 1px 1px shade($selected_bg_color, 0.8),
  1475. inset -1px -1px shade($selected_bg_color, 0.8);
  1476. }
  1477. &:disabled {
  1478. color: $insensitive_fg_color;
  1479. &:backdrop { color: $backdrop_insensitive_color; }
  1480. }
  1481. &:backdrop,
  1482. &:backdrop:hover {
  1483. color: $backdrop_fg_color;
  1484. background-color: transparent;
  1485. }
  1486. // submenu indicators
  1487. arrow {
  1488. min-height: 16px;
  1489. min-width: 16px;
  1490. &:dir(ltr) {
  1491. -gtk-icon-source: -gtk-icontheme('pan-end-symbolic');
  1492. margin-left: 10px;
  1493. }
  1494. &:dir(rtl) {
  1495. -gtk-icon-source:-gtk-icontheme('pan-end-symbolic-rtl');
  1496. margin-right: 10px;
  1497. }
  1498. }
  1499. // avoids labels color being overridden, see
  1500. // https://bugzilla.gnome.org/show_bug.cgi?id=767058
  1501. label { &:dir(rtl), &:dir(ltr) { color: inherit; }}
  1502. }
  1503. // overflow arrows
  1504. > arrow {
  1505. @include button(undecorated);
  1506. min-height: 16px;
  1507. min-width: 16px;
  1508. padding: 4px;
  1509. background-color: $menu_color;
  1510. border-radius: 0;
  1511. &.top {
  1512. margin-top: -6px;
  1513. border-bottom: 1px solid mix($fg_color, $base_color, 10%);
  1514. -gtk-icon-source: -gtk-icontheme('pan-up-symbolic');
  1515. }
  1516. &.bottom {
  1517. margin-bottom: -6px;
  1518. border-top: 1px solid mix($fg_color, $base_color, 10%);
  1519. -gtk-icon-source: -gtk-icontheme('pan-down-symbolic');
  1520. }
  1521. &:hover { background-color: mix($fg_color, $base_color, 10%); }
  1522. &:backdrop { background-color: $backdrop_menu_color; }
  1523. &:disabled {
  1524. color: transparent;
  1525. background-color: transparent;
  1526. border-color: transparent ;
  1527. }
  1528. }
  1529. }
  1530. menuitem {
  1531. accelerator { color: gtkalpha(currentColor,0.55); }
  1532. check,
  1533. radio {
  1534. min-height: 16px;
  1535. min-width: 16px;
  1536. &:dir(ltr) { margin-right: 7px; }
  1537. &:dir(rtl) { margin-left: 7px; }
  1538. }
  1539. }
  1540. /***************
  1541. * Popovers *
  1542. ***************/
  1543. popover.background {
  1544. padding: 2px;
  1545. border-radius: 5px;
  1546. background-color: $popover_bg_color;
  1547. modelbutton:hover { color: $selected_fg_color; }
  1548. .csd &, & { border: 1px solid $borders_color; }
  1549. box-shadow: 0 1px 2px transparentize(black, 0.7);
  1550. &:backdrop {
  1551. background-color: $backdrop_bg_color;
  1552. box-shadow: none;
  1553. }
  1554. > list,
  1555. > .view,
  1556. > toolbar {
  1557. border-style: none;
  1558. background-color: transparent;
  1559. }
  1560. .csd &, & {
  1561. &.touch-selection,
  1562. &.magnifier {
  1563. @extend %osd;
  1564. border: 1px solid transparentize(white, 0.9);
  1565. button { @extend %osd_button };
  1566. }
  1567. &.osd { @extend %osd; }
  1568. }
  1569. separator { margin: 3px; }
  1570. list separator { margin: 0px; }
  1571. checkbutton,
  1572. radiobutton { @extend modelbutton.flat; }
  1573. }
  1574. /*************
  1575. * Notebooks *
  1576. *************/
  1577. notebook {
  1578. &.frame { border-style: none; }
  1579. > header {
  1580. padding: 1px;
  1581. background-color: $bg_color;
  1582. &:backdrop {
  1583. border-color: $backdrop_borders_color;
  1584. background-color: $backdrop_bg_color;
  1585. }
  1586. tabs { margin: -1px; }
  1587. &.top {
  1588. > stack { border-top-style: none; }
  1589. > tabs > tab {
  1590. border-radius: 3px 3px 0 0;
  1591. border: 1px solid shade($bg_color, 0.9);
  1592. &:backdrop { box-shadow: none; }
  1593. &:checked { border-width: 1px 1px 0 1px; }
  1594. }
  1595. }
  1596. &.bottom {
  1597. > stack { border-bottom-style: none; }
  1598. > tabs > tab {
  1599. border-radius: 0 0 3px 3px;
  1600. &:backdrop { box-shadow: none; }
  1601. &:checked { border-width: 0 1px 1px 1px; }
  1602. }
  1603. }
  1604. &.left {
  1605. > stack { border-left-style: none; }
  1606. > tabs > tab {
  1607. border-radius: 3px 0 0 3px;
  1608. &:backdrop { box-shadow: none; }
  1609. &:checked { border-width: 1px 0 1px 1px; }
  1610. }
  1611. }
  1612. &.right {
  1613. > stack { border-right-style: none; }
  1614. > tabs > tab {
  1615. border-radius: 0 3px 3px 0;
  1616. &:backdrop { box-shadow: none; }
  1617. &:checked { border-width: 1px 1px 1px 0; }
  1618. }
  1619. }
  1620. &.top > tabs > arrow {
  1621. @extend %notebook_vert_arrows;
  1622. border-top-style: none;
  1623. }
  1624. &.bottom > tabs > arrow {
  1625. @extend %notebook_vert_arrows;
  1626. border-bottom-style: none;
  1627. }
  1628. @at-root %notebook_vert_arrows {
  1629. margin-left: -5px;
  1630. margin-right: -5px;
  1631. padding-left: 4px;
  1632. padding-right: 4px;
  1633. &.down { -gtk-icon-source: -gtk-icontheme('pan-start-symbolic'); }
  1634. &.up { -gtk-icon-source: -gtk-icontheme('pan-end-symbolic'); }
  1635. }
  1636. &.left > tabs > arrow {
  1637. @extend %notebook_horz_arrows;
  1638. border-left-style: none;
  1639. }
  1640. &.right > tabs > arrow {
  1641. @extend %notebook_horz_arrows;
  1642. border-right-style: none;
  1643. }
  1644. @at-root %notebook_horz_arrows {
  1645. margin-top: -5px;
  1646. margin-bottom: -5px;
  1647. padding-top: 4px;
  1648. padding-bottom: 4px;
  1649. &.down { -gtk-icon-source: -gtk-icontheme('pan-up-symbolic'); }
  1650. &.up { -gtk-icon-source: -gtk-icontheme('pan-down-symbolic'); }
  1651. }
  1652. > tabs > arrow {
  1653. @extend %button_basic;
  1654. @extend %button_basic.flat;
  1655. min-height: 16px;
  1656. min-width: 16px;
  1657. border-radius: 0;
  1658. &:hover:not(:active):not(:backdrop) {
  1659. background-clip: padding-box;
  1660. background-image: none;
  1661. background-color: transparentize(white, 0.7);
  1662. border-color: transparent;
  1663. box-shadow: none;
  1664. }
  1665. &:disabled { @include button(undecorated); }
  1666. }
  1667. tab {
  1668. min-height: 20px;
  1669. min-width: 24px;
  1670. padding: 3px 12px;
  1671. outline-offset: -5px;
  1672. color: $insensitive_fg_color;
  1673. background-color: $bg_color;
  1674. border-width: 1px; // for reorderable tabs
  1675. border-radius: 3px;
  1676. border-color: shade($bg_color, 0.9); //
  1677. border-style: solid;
  1678. &:hover {
  1679. color: mix($insensitive_fg_color, $fg_color, 50%);
  1680. &.reorderable-page {
  1681. border-color: transparentize($borders_color, 0.7);
  1682. background-color: transparentize($bg_color, 0.8);
  1683. }
  1684. }
  1685. &:backdrop {
  1686. color: mix($backdrop_fg_color, $backdrop_bg_color, 60%);
  1687. &.reorderable-page {
  1688. border-color: transparent;
  1689. background-color: transparent;
  1690. }
  1691. }
  1692. &:checked {
  1693. color: $fg_color;
  1694. background-color: shade($bg_color, 1.05);
  1695. border-width: 1px 1px 0 1px;
  1696. &:backdrop {
  1697. background-color: $bg_color;
  1698. }
  1699. &.reorderable-page {
  1700. border-color: transparentize($borders_color, 0.5);
  1701. background-color: shade($bg_color, 1.05);
  1702. }
  1703. }
  1704. &:backdrop:checked {
  1705. color: $backdrop_fg_color;
  1706. &.reorderable-page {
  1707. border-color: $backdrop_borders_color;
  1708. background-color: $backdrop_bg_color;
  1709. }
  1710. }
  1711. // colors the button like the label, overridden otherwise
  1712. button.flat {
  1713. &:hover { color: currentColor; }
  1714. &, &:backdrop { color: gtkalpha(currentColor, 0.3); }
  1715. padding: 0;
  1716. margin-top: 1px;
  1717. margin-bottom: 1px;
  1718. // FIXME: generalize .small-button?
  1719. min-width: 16px;
  1720. min-height: 16px;
  1721. &:last-child {
  1722. margin-left: 1px;
  1723. margin-right: -1px;
  1724. }
  1725. &:first-child {
  1726. margin-left: -1px;
  1727. margin-right: 1px;
  1728. }
  1729. }
  1730. }
  1731. &.top,
  1732. &.bottom {
  1733. tabs {
  1734. padding: 0;
  1735. &:not(:only-child) {
  1736. margin-left: 2px;
  1737. margin-right: 2px;
  1738. }
  1739. &:first-child { margin-left: -3px; }
  1740. &:last-child { margin-right: -3px; }
  1741. tab {
  1742. margin-left: 2px;
  1743. margin-right: 2px;
  1744. }
  1745. }
  1746. }
  1747. &.left,
  1748. &.right {
  1749. tabs {
  1750. padding: 0;
  1751. &:not(:only-child) {
  1752. margin-top: 2px;
  1753. margin-bottom: 2px;
  1754. }
  1755. &:first-child { margin-top: -3px; }
  1756. &:last-child { margin-bottom: -3px; }
  1757. tab {
  1758. margin-top: 2px;
  1759. margin-bottom: 2px;
  1760. }
  1761. }
  1762. }
  1763. &.top tab { padding-bottom: 4px; }
  1764. &.bottom tab { padding-top: 4px; }
  1765. }
  1766. &.frame {
  1767. > header {
  1768. &.top > tabs {
  1769. margin-bottom: -2px;
  1770. }
  1771. &.bottom > tabs {
  1772. margin-top: -2px;
  1773. }
  1774. &.left > tabs {
  1775. margin-right: -2px;
  1776. }
  1777. &.right > tabs {
  1778. margin-left: -2px;
  1779. }
  1780. }
  1781. > stack:not(:only-child) { // the :not(:only-child) is for "hidden" notebooks
  1782. background-color: shade($bg_color, 1.05);
  1783. border: 1px solid shade($bg_color, 0.9);
  1784. &:backdrop { background-color: $backdrop_bg_color; }
  1785. }
  1786. }
  1787. }
  1788. /**************
  1789. * Scrollbars *
  1790. **************/
  1791. scrollbar {
  1792. $_slider_min_length: 40px;
  1793. // disable steppers
  1794. @at-root * {
  1795. -GtkScrollbar-has-backward-stepper: false;
  1796. -GtkScrollbar-has-forward-stepper: false;
  1797. }
  1798. background-image: linear-gradient(to right,
  1799. lighten($bg_color, 10%),
  1800. lighten($bg_color, 30%)
  1801. );
  1802. transition: 300ms $ease-out-quad;
  1803. // scrollbar border
  1804. &.top { border-bottom: 1px solid lighten($bg_color, 5%); }
  1805. &.bottom { border-top: 1px solid lighten($bg_color, 5%); }
  1806. &.left { border-right: 1px solid lighten($bg_color, 5%); }
  1807. &.right { border-left: 1px solid lighten($bg_color, 5%); }
  1808. &:backdrop {
  1809. background-color: $backdrop_scrollbar_bg_color;
  1810. border-color: lighten($bg_color, 5%);
  1811. transition: $backdrop_transition;
  1812. }
  1813. // slider
  1814. slider {
  1815. min-width: 7px;
  1816. min-height: 7px;
  1817. margin: 3px;
  1818. border: 1px solid darken($bg_color, 30%);
  1819. border-radius: 10px;
  1820. background-clip: padding-box;
  1821. background-image: linear-gradient(to right,
  1822. lighten($scrollbar_slider_color, 5%),
  1823. lighten($scrollbar_slider_color, 1%));
  1824. &:hover {
  1825. background-image: linear-gradient(to right,
  1826. darken($scrollbar_slider_color, 5%),
  1827. darken($scrollbar_slider_color, 1%));
  1828. }
  1829. &:hover:active { background-color: $scrollbar_slider_active_color; }
  1830. &:backdrop { background-color: $backdrop_scrollbar_slider_color; }
  1831. &:disabled { background-color: transparent; }
  1832. }
  1833. &.fine-tune {
  1834. slider {
  1835. min-width: 4px;
  1836. min-height: 4px;
  1837. }
  1838. &.horizontal slider { border-width: 5px 4px; }
  1839. &.vertical slider { border-width: 4px 5px; }
  1840. }
  1841. &.overlay-indicator {
  1842. &:not(.dragging):not(.hovering) {
  1843. border-color: transparent;
  1844. opacity: 0.4;
  1845. background-color: transparent;
  1846. slider {
  1847. margin: 0;
  1848. min-width: 6px;
  1849. min-height: 6px;
  1850. background-color: shade($fg_color, 0.9);
  1851. background-image: none;
  1852. border: 1px solid if($variant == 'light', white, black);
  1853. }
  1854. button {
  1855. min-width: 5px;
  1856. min-height: 5px;
  1857. background-color: shade($fg_color, 0.9);
  1858. background-image: none;
  1859. background-clip: padding-box;
  1860. border-radius: 100%;
  1861. border: 1px solid if($variant == 'light', white, black);
  1862. -gtk-icon-source: none;
  1863. }
  1864. &.horizontal {
  1865. slider {
  1866. margin: 0 2px;
  1867. min-width: $_slider_min_length;
  1868. }
  1869. button {
  1870. margin: 1px 2px;
  1871. min-width: 5px;
  1872. }
  1873. }
  1874. &.vertical {
  1875. slider {
  1876. margin: 2px 0;
  1877. min-height: $_slider_min_length;
  1878. }
  1879. button {
  1880. margin: 2px 1px;
  1881. min-height: 5px;
  1882. }
  1883. }
  1884. }
  1885. &.dragging,
  1886. &.hovering { opacity: 0.8; }
  1887. }
  1888. &.horizontal slider { min-width: $_slider_min_length; }
  1889. &.vertical slider { min-height: $_slider_min_length; }
  1890. // button styling
  1891. button {
  1892. padding: 0;
  1893. min-width: 12px;
  1894. min-height: 12px;
  1895. border-style: none;
  1896. border-radius: 0;
  1897. transition-property: min-height, min-width, color;
  1898. @include button(undecorated);
  1899. color: $scrollbar_slider_color;
  1900. &:hover {
  1901. @include button(undecorated);
  1902. color: $scrollbar_slider_hover_color;
  1903. }
  1904. &:active, &:checked {
  1905. @include button(undecorated);
  1906. color: $scrollbar_slider_active_color;
  1907. }
  1908. &:disabled {
  1909. @include button(undecorated);
  1910. color: transparentize($scrollbar_slider_color, 0.8);
  1911. }
  1912. &:backdrop {
  1913. @include button(undecorated);
  1914. color: $backdrop_scrollbar_slider_color;
  1915. &:disabled {
  1916. @include button(undecorated);
  1917. color: transparentize($backdrop_scrollbar_slider_color, 0.8);
  1918. }
  1919. }
  1920. }
  1921. // button icons
  1922. &.vertical {
  1923. button {
  1924. &.down { -gtk-icon-source: -gtk-icontheme('pan-down-symbolic'); }
  1925. &.up { -gtk-icon-source: -gtk-icontheme('pan-up-symbolic'); }
  1926. }
  1927. }
  1928. &.horizontal {
  1929. button {
  1930. &.down { -gtk-icon-source: -gtk-icontheme('pan-end-symbolic'); }
  1931. &.up { -gtk-icon-source: -gtk-icontheme('pan-start-symbolic'); }
  1932. }
  1933. }
  1934. }
  1935. treeview ~ scrollbar.vertical {
  1936. border-top: 1px solid $borders_color;
  1937. margin-top: -1px;
  1938. }
  1939. /**********
  1940. * Switch *
  1941. **********/
  1942. switch {
  1943. font-size: 0;
  1944. outline-offset: -4px;
  1945. box-shadow: inset 0 1px transparentize(black, 0.9), // needs to be set here
  1946. _widget_edge(transparent); // otherwise it gets
  1947. // clipped
  1948. // similar to the .scale
  1949. border: 1px solid gtkalpha(black, 0.25);
  1950. border-radius: 10px;
  1951. background-color: mix($bg_color, $borders_color, 60%);
  1952. text-shadow: 0 1px transparentize(black, 0.9);
  1953. min-height: 20px;
  1954. min-width: 20px;
  1955. transition: all 200ms ease-in;
  1956. &:checked {
  1957. box-shadow: inset 0 1px transparentize(black, 0.9),
  1958. _widget_edge(transparent);
  1959. border-color: shade($selected_borders_color, 1.1);
  1960. background-image: linear-gradient(to bottom,
  1961. shade($selected_bg_color, 1.1),
  1962. $selected_bg_color
  1963. );
  1964. text-shadow: 0 1px transparentize($selected_borders_color, 0.5),
  1965. 0 0 2px transparentize(white, 0.4);
  1966. }
  1967. &:disabled {
  1968. border-color: $borders_color;
  1969. background-color: $insensitive_bg_color;
  1970. box-shadow: _widget_edge(transparent);
  1971. text-shadow: none;
  1972. }
  1973. &:backdrop {
  1974. border-color: $backdrop_borders_color;
  1975. background-color: $backdrop_dark_fill;
  1976. box-shadow: none;
  1977. text-shadow: none;
  1978. transition: $backdrop_transition;
  1979. &:checked {
  1980. @if $variant == 'light' { color: $backdrop_bg_color; }
  1981. border-color: transparentize($selected_borders_color, 0.3);
  1982. background-color: transparentize($selected_bg_color, 0.3);
  1983. background-image: none;
  1984. box-shadow: none;
  1985. }
  1986. }
  1987. &:disabled {
  1988. border-color: $backdrop_borders_color;
  1989. background-image: none;
  1990. background-color: $insensitive_bg_color;
  1991. }
  1992. slider {
  1993. margin: -1px;
  1994. border: 1px solid gtkalpha(black, 0.2);
  1995. border-radius: 10px;
  1996. min-width: 20px;
  1997. min-height: 20px;
  1998. transition: $button_transition;
  1999. @include button(normal-alt, $edge: $shadow_color);
  2000. }
  2001. &:hover slider { @include button(hover-alt, $edge: $shadow_color); }
  2002. &:checked slider { border: 1px solid gtkalpha($selected_borders_color, 0.8); }
  2003. &:disabled slider { @include button(insensitive); }
  2004. &:backdrop {
  2005. slider {
  2006. transition: $backdrop_transition;
  2007. @include button(backdrop);
  2008. }
  2009. &:checked slider { border-color: transparentize($selected_borders_color, 0.3); }
  2010. &:disabled slider { @include button(backdrop-insensitive); }
  2011. }
  2012. row:selected & {
  2013. @if $variant == 'light' {
  2014. box-shadow: none;
  2015. border-color: $selected_borders_color;
  2016. &:backdrop { border-color: $selected_borders_color; }
  2017. &.slider:dir(rtl) { border-left-color: $borders_color; }
  2018. &.slider:dir(ltr) { border-right-color: $borders_color; }
  2019. &.slider { &:checked, & { border-color: $selected_borders_color; } }
  2020. }
  2021. }
  2022. }
  2023. /*************************
  2024. * Check and Radio items *
  2025. *************************/
  2026. // draw regular check and radio items using our PNG assets
  2027. // all assets are rendered from assets.svg. never add pngs directly
  2028. //selection-mode
  2029. @each $s,$as in ('','-selectionmode'),
  2030. (':hover', '-hover-selectionmode'),
  2031. (':active', '-active-selectionmode'),
  2032. (':backdrop', '-backdrop-selectionmode'),
  2033. (':checked', '-checked-selectionmode'),
  2034. (':checked:hover', '-checked-hover-selectionmode'),
  2035. (':checked:active', '-checked-active-selectionmode'),
  2036. (':backdrop:checked', '-checked-backdrop-selectionmode') {
  2037. .view.content-view.check#{$s}:not(list) {
  2038. -gtk-icon-shadow: none;
  2039. -gtk-icon-source: -gtk-scaled(url("assets/checkbox#{$as}.png"),
  2040. url("assets/checkbox#{$as}@2.png"));
  2041. background-color: transparent;
  2042. }
  2043. }
  2044. checkbutton.text-button, radiobutton.text-button {
  2045. // this is for a nice focus on check and radios text
  2046. padding: 2px 0;
  2047. outline-offset: 0;
  2048. label:not(:only-child) {
  2049. &:first-child { margin-left: 4px; }
  2050. &:last-child { margin-right: 4px; }
  2051. }
  2052. }
  2053. check,
  2054. radio {
  2055. margin: 0 4px;
  2056. &:only-child { margin: 0; }
  2057. min-height: 14px;
  2058. min-width: 14px;
  2059. border: 1px solid;
  2060. -gtk-icon-source: none;
  2061. @include button(normal-alt, $c:lighten($bg_color, 5%), $edge: $shadow_color);
  2062. &:hover { @include button(hover-alt, $edge: $shadow_color); }
  2063. &:active { @include button(active); }
  2064. &:disabled { @include button(insensitive); }
  2065. &:backdrop {
  2066. @include button(backdrop);
  2067. transition: $backdrop_transition;
  2068. &:disabled { @include button(backdrop-insensitive); }
  2069. }
  2070. @if $variant == 'light' {
  2071. // the borders of the light variant versions of checks and radios are too similar in luminosity to the selected background
  2072. // color, hence we need special casing.
  2073. row:selected & { border-color: $selected_borders_color; }
  2074. }
  2075. .osd & {
  2076. @include button(osd);
  2077. &:hover { @include button(osd); }
  2078. &:active { @include button(osd-active); }
  2079. &:backdrop { @include button(osd-backdrop); }
  2080. &:disabled { @include button(osd-insensitive); }
  2081. }
  2082. menu menuitem & {
  2083. margin: 0; // this is a workaround for a menu check/radio size allocation issue
  2084. &, &:hover, &:disabled { //FIXME use button reset mixin
  2085. min-height: 14px;
  2086. min-width: 14px;
  2087. background-image: none;
  2088. background-color: transparent;
  2089. box-shadow: none;
  2090. -gtk-icon-shadow: none;
  2091. color: inherit;
  2092. border-color: currentColor;
  2093. animation: none;
  2094. }
  2095. }
  2096. }
  2097. %check,
  2098. check {
  2099. border-radius: 3px;
  2100. &:checked { -gtk-icon-source: image(-gtk-recolor(url("assets/check-symbolic.svg")),
  2101. -gtk-recolor(url("assets/check-symbolic.symbolic.png"))); }
  2102. &:indeterminate { -gtk-icon-source: image(-gtk-recolor(url("assets/dash-symbolic.svg")),
  2103. -gtk-recolor(url("assets/dash-symbolic.symbolic.png"))); }
  2104. }
  2105. %radio,
  2106. radio {
  2107. border-radius: 100%;
  2108. &:checked { -gtk-icon-source: image(-gtk-recolor(url("assets/bullet-symbolic.svg")),
  2109. -gtk-recolor(url("assets/bullet-symbolic.symbolic.png"))); }
  2110. &:indeterminate { -gtk-icon-source: image(-gtk-recolor(url("assets/dash-symbolic.svg")),
  2111. -gtk-recolor(url("assets/dash-symbolic.symbolic.png"))); }
  2112. }
  2113. // let's animate things
  2114. @keyframes check_check {
  2115. from { -gtk-icon-transform: translate(6px, -3px) rotate(-45deg) scaleY(0.2) rotate(45deg) scaleX(0); }
  2116. to { -gtk-icon-transform: unset; }
  2117. }
  2118. @keyframes check_radio {
  2119. from { -gtk-icon-transform: scale(0); }
  2120. to { -gtk-icon-transform: unset; }
  2121. }
  2122. @keyframes check_indeterminate {
  2123. from { -gtk-icon-transform: scale(0, 1); }
  2124. to { -gtk-icon-transform: unset; }
  2125. }
  2126. check:not(:indeterminate):checked { animation: check_check 400ms; }
  2127. radio:not(:indeterminate):checked { animation: check_radio 400ms; }
  2128. check:indeterminate:checked, radio:indeterminate:checked { animation: check_indeterminate 400ms; }
  2129. // no animations in menus
  2130. menu menuitem {
  2131. check:not(:indeterminate):checked,
  2132. radio:not(:indeterminate):checked,
  2133. check:indeterminate:checked:active,
  2134. radio:indeterminate:checked { animation: none; }
  2135. }
  2136. treeview.view check,
  2137. treeview.view radio {
  2138. &:selected {
  2139. &:focus, & {
  2140. color: $fg_color;
  2141. @if $variant == 'light' { border-color: $selected_borders_color; }
  2142. }
  2143. &:disabled {
  2144. color: $insensitive_fg_color;
  2145. &:backdrop { color: $backdrop_insensitive_color; }
  2146. }
  2147. }
  2148. &:backdrop { &:selected, & { color: $backdrop_fg_color; }}
  2149. }
  2150. treeview.view radio:selected { &:focus, & { @extend %radio; }} // This is a workaround
  2151. /************
  2152. * GtkScale *
  2153. ************/
  2154. %scale_trough {
  2155. border: 1px solid $borders_color;
  2156. border-radius: 3px;
  2157. background-color: $dark_fill;
  2158. box-shadow: inset 1px 1px transparentize(black, 0.9);
  2159. &:disabled {
  2160. background-color: $insensitive_bg_color;
  2161. box-shadow: none;
  2162. }
  2163. &:backdrop {
  2164. background-color: $backdrop_dark_fill;
  2165. border-color: $backdrop_borders_color;
  2166. box-shadow: none;
  2167. transition: $backdrop_transition;
  2168. &:disabled { background-color: $insensitive_bg_color; }
  2169. }
  2170. // ...on selected list rows
  2171. row:selected & {
  2172. box-shadow: none;
  2173. &, &:disabled { border-color: $selected_borders_color; }
  2174. }
  2175. // OSD
  2176. .osd & {
  2177. border-color: $osd_borders_color;
  2178. background-color: transparentize($osd_borders_color, 0.2);
  2179. box-shadow: none;
  2180. outline-color: transparentize($osd_fg_color, 0.8);
  2181. &:disabled { background-color: $osd_insensitive_bg_color; }
  2182. }
  2183. }
  2184. %scale_highlight {
  2185. border: 1px solid shade($selected_bg_color, 0.7);
  2186. border-radius: 3px;
  2187. background-image: linear-gradient(to bottom,
  2188. shade($selected_bg_color, 1.1),
  2189. shade($selected_bg_color, 0.9)
  2190. );
  2191. &:disabled {
  2192. background-color: transparent;
  2193. border-color: transparent;
  2194. }
  2195. &:backdrop {
  2196. border-color: transparentize($selected_borders_color, 0.3);
  2197. background-color: transparentize($selected_bg_color, 0.3);
  2198. background-image: none;
  2199. &:disabled {
  2200. background-color: transparent;
  2201. border-color: transparent;
  2202. }
  2203. }
  2204. // ...on selected list rows
  2205. row:selected & { &:disabled, & { border-color: $selected_borders_color; } }
  2206. // OSD
  2207. .osd & {
  2208. border-color: $osd_borders_color;
  2209. &:disabled { border-color: transparent; }
  2210. }
  2211. }
  2212. scale {
  2213. // sizing
  2214. $_marks_length: 6px;
  2215. $_marks_distance: 6px;
  2216. min-height: 10px;
  2217. min-width: 10px;
  2218. padding: 12px;
  2219. // those are inside the trough node, I need them to show their own border over the trough one, so negative margin
  2220. fill,
  2221. highlight { margin: -2px; }
  2222. // the slider is inside the trough, so to have make it bigger there's a negative margin
  2223. slider {
  2224. min-height: 13px;
  2225. min-width: 13px;
  2226. margin: -7px;
  2227. }
  2228. // click-and-hold the slider to activate
  2229. &.fine-tune {
  2230. &.horizontal {
  2231. padding-top: 9px;
  2232. padding-bottom: 9px;
  2233. min-height: 16px;
  2234. }
  2235. &.vertical {
  2236. padding-left: 9px;
  2237. padding-right: 9px;
  2238. min-width: 16px;
  2239. }
  2240. // to make the trough grow in fine-tune mode
  2241. slider { margin: -6px; }
  2242. fill,
  2243. highlight,
  2244. trough {
  2245. border-radius: 5px;
  2246. -gtk-outline-radius: 7px;
  2247. }
  2248. }
  2249. // the backing bit
  2250. trough {
  2251. @extend %scale_trough;
  2252. padding: 1px;
  2253. outline-offset: 2px;
  2254. -gtk-outline-radius: 5px;
  2255. }
  2256. // the colored part of the backing bit
  2257. highlight { @extend %scale_highlight; }
  2258. // this is another differently styled part of the backing bit, the most relevant use case is for example
  2259. // in media player to indicate how much video stream has been cached
  2260. fill {
  2261. @extend %scale_trough;
  2262. &, &:backdrop {
  2263. background-color: $borders_color;
  2264. box-shadow: none;
  2265. }
  2266. &:disabled {
  2267. &, &:backdrop {
  2268. border-color: transparent;
  2269. background-color: transparent;
  2270. }
  2271. }
  2272. // OSD
  2273. .osd & {
  2274. background-color: mix($osd_fg_color, $osd_borders_color, 25%);
  2275. &:disabled {
  2276. &, &:backdrop {
  2277. border-color: transparent;
  2278. background-color: transparent;
  2279. }
  2280. }
  2281. }
  2282. }
  2283. slider {
  2284. @include button(normal);
  2285. background-image: linear-gradient(to bottom,
  2286. shade($bg_color, 1.45),
  2287. shade($bg_color, 1.15)
  2288. );
  2289. border: 1px solid darken($borders_color, 3%);
  2290. border-radius: 100%;
  2291. transition: $button_transition;
  2292. transition-property: background, border, box-shadow;
  2293. &:hover { @include button(hover-alt, $edge: $shadow_color); }
  2294. &:active { border-color: $selected_borders_color; }
  2295. &:disabled { @include button (insensitive); }
  2296. &:backdrop {
  2297. transition: $backdrop_transition;
  2298. @include button(backdrop);
  2299. &:disabled { @include button(backdrop-insensitive); }
  2300. }
  2301. // ...on selected list rows
  2302. row:selected & { &, &:disabled { border-color: $selected_borders_color; } }
  2303. // OSD
  2304. .osd & {
  2305. @include button(osd);
  2306. border-color: darken($osd_borders_color, 3%);
  2307. background-color: opacify($osd_bg_color, 1); // solid background needed here
  2308. &:hover { @include button(osd-hover); }
  2309. &:active { @include button(osd-active); }
  2310. &:disabled { @include button(osd-insensitive); }
  2311. &:backdrop {
  2312. @include button(osd-backdrop);
  2313. &:disabled { @include button(osd-backdrop-insensitive); }
  2314. }
  2315. }
  2316. }
  2317. value { color: gtkalpha(currentColor, 0.6); }
  2318. marks {
  2319. color: gtkalpha(currentColor, 0.4);
  2320. @each $marks_class, $marks_pos, $marks_margin in (top, top, bottom),
  2321. (bottom, bottom, top),
  2322. (top, left, right),
  2323. (bottom, right, left) {
  2324. &.#{$marks_class} {
  2325. margin-#{$marks_margin}: $_marks_distance;
  2326. margin-#{$marks_pos}: -($_marks_distance + $_marks_length);
  2327. }
  2328. }
  2329. }
  2330. &.fine-tune marks {
  2331. @each $marks_class, $marks_pos, $marks_margin in (top, top, bottom),
  2332. (bottom, bottom, top),
  2333. (top, left, right),
  2334. (bottom, right, left) {
  2335. &.#{$marks_class} {
  2336. margin-#{$marks_margin}: $_marks_distance;
  2337. margin-#{$marks_pos}: -($_marks_distance + $_marks_length - 3px);
  2338. }
  2339. }
  2340. }
  2341. &.horizontal {
  2342. indicator {
  2343. min-height: $_marks_length;
  2344. min-width: 1px;
  2345. }
  2346. &.fine-tune indicator { min-height: ($_marks_length - 3px); }
  2347. }
  2348. &.vertical {
  2349. indicator {
  2350. min-height: 1px;
  2351. min-width: $_marks_length;
  2352. }
  2353. &.fine-tune indicator { min-width: ($_marks_length - 3px); }
  2354. }
  2355. &.color {
  2356. min-height: 0;
  2357. min-width: 0;
  2358. trough {
  2359. background-image: image($borders_color);
  2360. background-repeat: no-repeat;
  2361. }
  2362. &.horizontal {
  2363. padding: 0 0 15px 0;
  2364. trough {
  2365. padding-bottom: 4px;
  2366. background-position: 0 -3px;
  2367. border-top-left-radius: 0;
  2368. border-top-right-radius: 0;
  2369. }
  2370. slider {
  2371. &:dir(ltr), &:dir(rtl) { // specificity bumb
  2372. &:hover, &:backdrop, &:disabled, &:backdrop:disabled, & {
  2373. margin-bottom: -15px;
  2374. margin-top: 6px;
  2375. }
  2376. }
  2377. }
  2378. }
  2379. &.vertical {
  2380. &:dir(ltr) {
  2381. padding: 0 0 0 15px;
  2382. trough {
  2383. padding-left: 4px;
  2384. background-position: 3px 0;
  2385. border-bottom-right-radius: 0;
  2386. border-top-right-radius: 0;
  2387. }
  2388. slider {
  2389. &:hover, &:backdrop, &:disabled, &:backdrop:disabled, & {
  2390. margin-left: -15px;
  2391. margin-right: 6px;
  2392. }
  2393. }
  2394. }
  2395. &:dir(rtl) {
  2396. padding: 0 15px 0 0;
  2397. trough {
  2398. padding-right: 4px;
  2399. background-position: -3px 0;
  2400. border-bottom-left-radius: 0;
  2401. border-top-left-radius: 0;
  2402. }
  2403. slider {
  2404. &:hover, &:backdrop, &:disabled, &:backdrop:disabled, & {
  2405. margin-right: -15px;
  2406. margin-left: 6px;
  2407. }
  2408. }
  2409. }
  2410. }
  2411. &.fine-tune {
  2412. &.horizontal {
  2413. &:dir(ltr), &:dir(rtl) { // specificity bump
  2414. padding: 0 0 12px 0;
  2415. trough {
  2416. padding-bottom: 7px;
  2417. background-position: 0 -6px;
  2418. }
  2419. slider {
  2420. margin-bottom: -15px;
  2421. margin-top: 6px;
  2422. }
  2423. }
  2424. }
  2425. &.vertical {
  2426. &:dir(ltr) {
  2427. padding: 0 0 0 12px;
  2428. trough {
  2429. padding-left: 7px;
  2430. background-position: 6px 0;
  2431. }
  2432. slider {
  2433. margin-left: -15px;
  2434. margin-right: 6px;
  2435. }
  2436. }
  2437. &:dir(rtl) {
  2438. padding: 0 12px 0 0;
  2439. trough {
  2440. padding-right: 7px;
  2441. background-position: -6px 0;
  2442. }
  2443. slider {
  2444. margin-right: -15px;
  2445. margin-left: 6px;
  2446. }
  2447. }
  2448. }
  2449. }
  2450. }
  2451. }
  2452. /*****************
  2453. * Progress bars *
  2454. *****************/
  2455. progressbar {
  2456. // sizing
  2457. &.horizontal {
  2458. trough { min-height: 6px; padding: 1px 0; }
  2459. progress { min-height: 8px; }
  2460. }
  2461. &.vertical {
  2462. trough { min-width: 6px; padding: 0 1px; }
  2463. progress { min-width: 8px; }
  2464. }
  2465. &.horizontal progress,
  2466. &.vertical progress { margin: 0; }
  2467. // FIXME: insensitive state missing and some other state should be set probably
  2468. font-size: smaller;
  2469. color: transparentize($fg_color, 0.6);
  2470. &:backdrop {
  2471. box-shadow: none;
  2472. transition: $backdrop_transition;
  2473. }
  2474. trough { @extend %scale_trough; }
  2475. &:backdrop trough { @extend %scale_trough:backdrop; } // looks like states are not passed to the trough component here
  2476. progress {
  2477. @extend %scale_highlight;
  2478. border: 1px solid shade($selected_bg_color, 0.7);
  2479. border-radius: 3px;
  2480. &.left {
  2481. border-top-left-radius: 3px;
  2482. border-bottom-left-radius: 3px;
  2483. }
  2484. &.right {
  2485. border-top-right-radius: 3px;
  2486. border-bottom-right-radius: 3px;
  2487. }
  2488. &.top {
  2489. border-top-right-radius: 3px;
  2490. border-top-left-radius: 3px;
  2491. }
  2492. &.bottom {
  2493. border-bottom-right-radius: 3px;
  2494. border-bottom-left-radius: 3px;
  2495. }
  2496. }
  2497. &:backdrop progress { // states not passed here as well
  2498. @extend %scale_highlight:backdrop;
  2499. box-shadow: none;
  2500. }
  2501. &.osd { // progressbar.osd used for epiphany page loading progress
  2502. min-width: 3px;
  2503. min-height: 3px;
  2504. background-color: transparent;
  2505. trough {
  2506. border-style: none;
  2507. border-radius: 0;
  2508. background-color: transparent;
  2509. box-shadow: none;
  2510. }
  2511. progress {
  2512. border-style: none;
  2513. border-radius: 0;
  2514. }
  2515. }
  2516. trough.empty progress { all: unset; } // makes the progress indicator disappear, when the fraction is 0
  2517. }
  2518. /*************
  2519. * Level Bar *
  2520. *************/
  2521. levelbar {
  2522. block {
  2523. min-width: 32px;
  2524. min-height: 1px;
  2525. }
  2526. &.vertical block {
  2527. min-width: 1px;
  2528. min-height: 32px;
  2529. }
  2530. &:backdrop { transition: $backdrop_transition; }
  2531. trough {
  2532. border: 1px solid;
  2533. padding: 2px;
  2534. border-radius: 3px;
  2535. @include entry(normal);
  2536. &:backdrop { @include entry(backdrop); }
  2537. }
  2538. &.horizontal.discrete block { margin: 0 1px; }
  2539. &.vertical.discrete block { margin: 1px 0; }
  2540. block {
  2541. border: 1px solid;
  2542. border-radius: 1px;
  2543. box-shadow: 0 1px transparentize(black, 0.8);
  2544. &:backdrop { box-shadow: none; }
  2545. &.low {
  2546. border-color: if($variant == 'light', darken($warning_color, 20%), $warning_color);
  2547. background-color: $warning_color;
  2548. &:backdrop { border-color: $warning_color; };
  2549. }
  2550. &.high,
  2551. &:not(.empty) {
  2552. border-color: if($variant == 'light', darken($selected_bg_color, 20%), $selected_bg_color);
  2553. background-color: $selected_bg_color;
  2554. &:backdrop { border-color: $selected_bg_color; }
  2555. }
  2556. &.full {
  2557. border-color: if($variant == 'light', darken($success_color, 20%), $success_color);
  2558. background-color: $success_color;
  2559. &:backdrop { border-color: $success_color; };
  2560. }
  2561. &.empty {
  2562. background-color: transparent;
  2563. border-color: if($variant == 'light', transparentize($fg_color,0.8), transparentize($fg_color,0.9));
  2564. box-shadow: none;
  2565. &:backdrop { border-color: transparentize($backdrop_fg_color,0.85); }
  2566. }
  2567. }
  2568. }
  2569. /****************
  2570. * Print dialog *
  2571. *****************/
  2572. printdialog {
  2573. paper {
  2574. color: $fg_color;
  2575. border: 1px solid $borders_color;
  2576. background: white;
  2577. padding: 0;
  2578. &:backdrop {
  2579. color: $backdrop_fg_color;
  2580. border-color: $backdrop_borders_color;
  2581. }
  2582. }
  2583. .dialog-action-box { margin: 12px; }
  2584. }
  2585. /**********
  2586. * Frames *
  2587. **********/
  2588. frame > border,
  2589. .frame {
  2590. box-shadow: none;
  2591. margin: 0;
  2592. padding: 0;
  2593. border-radius: 0;
  2594. border: 1px solid $borders_color;
  2595. &.flat { border-style: none; }
  2596. &:backdrop { border-color: $backdrop_borders_color; }
  2597. }
  2598. actionbar > revealer > box {
  2599. padding: 6px;
  2600. border-top: 1px solid $borders_color;
  2601. &:backdrop { border-color: $backdrop_borders_color; }
  2602. }
  2603. scrolledwindow {
  2604. viewport.frame { // avoid double borders when viewport inside scrolled window
  2605. border-style: none;
  2606. }
  2607. // This is used when content is touch-dragged past boundaries.
  2608. // draws a box on top of the content, the size changes programmatically.
  2609. overshoot {
  2610. &.top {
  2611. @include overshoot(top);
  2612. &:backdrop { @include overshoot(top, backdrop); }
  2613. }
  2614. &.bottom {
  2615. @include overshoot(bottom);
  2616. &:backdrop { @include overshoot(bottom, backdrop); }
  2617. }
  2618. &.left {
  2619. @include overshoot(left);
  2620. &:backdrop { @include overshoot(left, backdrop); }
  2621. }
  2622. &.right {
  2623. @include overshoot(right);
  2624. &:backdrop { @include overshoot(right, backdrop); }
  2625. }
  2626. }
  2627. // Overflow indication, works similarly to the overshoot, the size if fixed tho.
  2628. undershoot {
  2629. &.top { @include undershoot(top); }
  2630. &.bottom { @include undershoot(bottom); }
  2631. &.left { @include undershoot(left); }
  2632. &.right { @include undershoot(right); }
  2633. }
  2634. junction { // the small square between two scrollbars
  2635. border-color: transparent;
  2636. // the border image is used to add the missing dot between the borders, details, details, details...
  2637. border-image: linear-gradient(to bottom, $borders_color 1px, transparent 1px) 0 0 0 1 / 0 1px stretch;
  2638. background-color: $scrollbar_bg_color;
  2639. &:dir(rtl) { border-image-slice: 0 1 0 0; }
  2640. &:backdrop {
  2641. border-image-source: linear-gradient(to bottom, $backdrop_borders_color 1px, transparent 1px);
  2642. background-color: $backdrop_scrollbar_bg_color;
  2643. transition: $backdrop_transition;
  2644. }
  2645. }
  2646. }
  2647. //vbox and hbox separators
  2648. separator {
  2649. background: transparentize(black, 0.9);
  2650. min-width: 1px;
  2651. min-height: 1px;
  2652. }
  2653. /*********
  2654. * Lists *
  2655. *********/
  2656. list {
  2657. color: $text_color;
  2658. background-color: $base_color;
  2659. border-color: $borders_color;
  2660. &:backdrop {
  2661. background-color: $backdrop_base_color;
  2662. border-color: $backdrop_borders_color;
  2663. }
  2664. row { padding: 2px; }
  2665. }
  2666. row {
  2667. transition: all 150ms $ease-out-quad;
  2668. &:hover { transition: none; }
  2669. &:backdrop { transition: $backdrop_transition; }
  2670. &.activatable {
  2671. &.has-open-popup, // this is for indicathing which row generated a popover see https://bugzilla.gnome.org/show_bug.cgi?id=754411
  2672. &:hover { background-color: if(variant == light, transparentize($fg_color, 0.9), transparentize($fg_color, 0.95)); }
  2673. &:active { box-shadow: inset 0 2px 2px -2px transparentize(black, 0.8); }
  2674. &:backdrop:hover { background-color: transparent; }
  2675. &:selected {
  2676. &:active { box-shadow: inset 0 2px 3px -1px transparentize(black, 0.5); }
  2677. &.has-open-popup,
  2678. &:hover { background-color: mix($fg_color, $selected_bg_color, 10%); }
  2679. &:backdrop { background-color: $selected_bg_color; }
  2680. }
  2681. }
  2682. &:selected { @extend %selected_items; }
  2683. }
  2684. /*********************
  2685. * App Notifications *
  2686. *********************/
  2687. .app-notification,
  2688. .app-notification.frame {
  2689. @extend %osd;
  2690. padding: 10px;
  2691. border-radius: 0 0 5px 5px;
  2692. background-color: $osd_bg_color;
  2693. background-image: linear-gradient(to bottom, transparentize(black, 0.8),
  2694. transparent 2px);
  2695. background-clip: padding-box;
  2696. &:backdrop {
  2697. background-image: none;
  2698. transition: $backdrop_transition;
  2699. }
  2700. button {
  2701. @extend %osd_button;
  2702. background: transparentize(black, 0.9);
  2703. &:hover { background: transparentize(black, 0.7); }
  2704. }
  2705. border { border: none; }
  2706. }
  2707. /*************
  2708. * Expanders *
  2709. *************/
  2710. expander {
  2711. arrow {
  2712. min-width: 16px;
  2713. min-height: 16px;
  2714. -gtk-icon-source: -gtk-icontheme('pan-end-symbolic');
  2715. &:dir(rtl) { -gtk-icon-source: -gtk-icontheme('pan-end-symbolic-rtl'); }
  2716. &:hover { color: lighten($fg_color,30%); } //only lightens the arrow
  2717. &:checked { -gtk-icon-source: -gtk-icontheme('pan-down-symbolic'); }
  2718. }
  2719. }
  2720. /************
  2721. * Calendar *
  2722. ***********/
  2723. calendar {
  2724. color: $text_color;
  2725. border: 1px solid $borders_color;
  2726. padding: 2px;
  2727. &:selected {
  2728. @extend %selected_items;
  2729. border-radius: 6px;
  2730. }
  2731. &.header {
  2732. border: none;
  2733. border-bottom: 1px solid transparentize(black, 0.9);
  2734. border-radius: 0;
  2735. &:backdrop { border-color: transparentize(black, 0.9); }
  2736. }
  2737. &.button {
  2738. @extend %undecorated_button;
  2739. color: transparentize($fg_color, 0.55);
  2740. &:hover {
  2741. @extend %undecorated_button;
  2742. color: $fg_color;
  2743. }
  2744. &:backdrop {
  2745. @extend %undecorated_button;
  2746. color: transparentize($backdrop_fg_color,0.55);
  2747. }
  2748. &:disabled {
  2749. @extend %undecorated_button;
  2750. color: transparentize($insensitive_fg_color,0.55);
  2751. }
  2752. }
  2753. // out-of-range days
  2754. &:indeterminate,
  2755. &:indeterminate:backdrop { color: gtkalpha(currentColor, 0.25); }
  2756. // .day-name and .week-number
  2757. &.highlight,
  2758. &.highlight:backdrop {
  2759. font-size: smaller;
  2760. color: darken($selected_bg_color,0.75);
  2761. }
  2762. &:backdrop {
  2763. color: $backdrop_text_color;
  2764. border-color: $backdrop_borders_color;
  2765. }
  2766. }
  2767. /***********
  2768. * Dialogs *
  2769. ***********/
  2770. messagedialog { // Message Dialog styling
  2771. .titlebar {
  2772. min-height: 20px;
  2773. background-image: none;
  2774. background-color: $bg_color;
  2775. border-style: none;
  2776. border-top-left-radius: 7px;
  2777. border-top-right-radius: 7px;
  2778. }
  2779. &.csd { // rounded bottom border styling for csd version
  2780. &.background {
  2781. // bigger radius for better antialiasing
  2782. border-bottom-left-radius: 9px;
  2783. border-bottom-right-radius: 9px;
  2784. }
  2785. buttonbox { padding: 0px; }
  2786. .dialog-action-area button {
  2787. padding: 10px 14px; // labels are not vertically centered on message dialog, this is a workaround
  2788. border-radius: 0;
  2789. border-left-style: solid;
  2790. border-right-style: none;
  2791. border-bottom-style: none;
  2792. &:first-child{
  2793. border-left-style: none;
  2794. border-bottom-left-radius: 7px;
  2795. -gtk-outline-bottom-left-radius: 5px;
  2796. }
  2797. &:last-child {
  2798. border-bottom-right-radius: 7px;
  2799. -gtk-outline-bottom-right-radius: 5px;
  2800. }
  2801. }
  2802. }
  2803. }
  2804. filechooser {
  2805. .dialog-action-box {
  2806. border-top: 1px solid $borders_color;
  2807. &:backdrop { border-top-color: $backdrop_borders_color; }
  2808. }
  2809. #pathbarbox {
  2810. border-bottom: 1px solid $bg_color;
  2811. stack { background-color: $bg_color; }
  2812. }
  2813. }
  2814. filechooserbutton:drop(active) {
  2815. box-shadow: none;
  2816. border-color: transparent;
  2817. }
  2818. /***********
  2819. * Sidebar *
  2820. ***********/
  2821. .sidebar {
  2822. border-style: none;
  2823. background-color: $sidebar_bg_color;
  2824. -gtk-icon-style: regular;
  2825. row,
  2826. treeview {
  2827. border-top: 1px solid transparent;
  2828. border-bottom: 1px solid transparent;
  2829. &:selected, &:selected:focus {
  2830. background-image: linear-gradient(to bottom,
  2831. shade($sidebar_bg_color, 0.87),
  2832. shade($sidebar_bg_color, 0.95) 10%,
  2833. shade($sidebar_bg_color, 0.99) 92%,
  2834. shade($sidebar_bg_color, 0.92)
  2835. );
  2836. border-top: 1px solid shade($bg_color, 0.85);
  2837. border-bottom: 1px solid shade($bg_color, 1.12);
  2838. label {
  2839. color: $fg_color;
  2840. &:backdrop { color: $backdrop_fg_color; }
  2841. }
  2842. &:backdrop {
  2843. background-image: none;
  2844. background-color: $bg_color;
  2845. color: $fg_color;
  2846. border-top: 1px solid shade($bg_color, 0.9);
  2847. border-bottom: 1px solid shade($bg_color, 0.9);
  2848. }
  2849. }
  2850. .view:selected, .view:selected:focus { color: $fg_color; }
  2851. &:backdrop { background-color: transparent; }
  2852. }
  2853. @at-root %sidebar_left,
  2854. &:dir(ltr),
  2855. &.left,
  2856. &.left:dir(rtl) {
  2857. border-right: 1px solid $borders_color;
  2858. border-left-style: none;
  2859. border-top-style: none;
  2860. border-bottom-style: none;
  2861. }
  2862. @at-root %sidebar_right
  2863. &:dir(rtl),
  2864. &.right {
  2865. border-left: 1px solid $borders_color;
  2866. border-right-style: none;
  2867. border-top-style: none;
  2868. border-bottom-style: none;
  2869. }
  2870. &:backdrop {
  2871. background-color: $backdrop_sidebar_bg_color;
  2872. border-color: $backdrop_borders_color;
  2873. transition: $backdrop_transition;
  2874. }
  2875. list, treeview {
  2876. background-color: transparent;
  2877. &:backdrop {
  2878. background-color: transparent;
  2879. }
  2880. }
  2881. paned & { &.left, &.right, &.left:dir(rtl), &:dir(rtl), &:dir(ltr), & { border-style: none; } }
  2882. }
  2883. stacksidebar {
  2884. &.sidebar {
  2885. &:dir(ltr),
  2886. &.left,
  2887. &.left:dir(rtl) { list { @extend %sidebar_left; }}
  2888. &:dir(rtl),
  2889. &.right { list { @extend %sidebar_right; }}
  2890. }
  2891. row {
  2892. padding: 10px 4px;
  2893. > label {
  2894. padding-left: 6px;
  2895. padding-right: 6px;
  2896. }
  2897. &.needs-attention > label {
  2898. @extend %needs_attention;
  2899. background-size: 6px 6px, 0 0;
  2900. }
  2901. }
  2902. }
  2903. /****************
  2904. * File chooser *
  2905. ****************/
  2906. $_placesidebar_icons_opacity: 0.7;
  2907. placessidebar {
  2908. > viewport.frame { border-style: none; }
  2909. row {
  2910. // Needs overriding of the GtkListBoxRow padding
  2911. min-height: 24px;
  2912. padding: 0px;
  2913. // Using margins/padding directly in the SidebarRow
  2914. // will make the animation of the new bookmark row jump
  2915. > revealer { padding: 0 14px; }
  2916. &:selected { color: $fg_color; }
  2917. &:disabled { color: $insensitive_fg_color; }
  2918. &:backdrop {
  2919. color: $backdrop_fg_color;
  2920. background-color: $backdrop_bg_color;
  2921. &:selected { color: $backdrop_fg_color; }
  2922. &:disabled { color: $backdrop_insensitive_color; }
  2923. }
  2924. image.sidebar-icon {
  2925. &:dir(ltr) { padding-right: 8px; }
  2926. &:dir(rtl) { padding-left: 8px; }
  2927. }
  2928. label.sidebar-label {
  2929. &:dir(ltr) { padding-right: 2px; }
  2930. &:dir(rtl) { padding-left: 2px; }
  2931. }
  2932. @at-root button.sidebar-button {
  2933. @extend %button_basic.flat;
  2934. @extend %button_selected.flat;
  2935. min-height: 26px;
  2936. min-width: 26px;
  2937. margin-top: 3px;
  2938. margin-bottom: 3px;
  2939. padding: 0;
  2940. border-radius: 100%;
  2941. -gtk-outline-radius: 100%;
  2942. &:not(:hover):not(:active),
  2943. &:backdrop { > image { opacity: $_placesidebar_icons_opacity; }}
  2944. }
  2945. // in the sidebar case it makes no sense to click the selected row
  2946. &:selected:active { box-shadow: none; }
  2947. &.sidebar-placeholder-row {
  2948. padding: 0 8px;
  2949. min-height: 2px;
  2950. background-image: image($drop_target_color);
  2951. background-clip: content-box;
  2952. }
  2953. &.sidebar-new-bookmark-row { color: $selected_bg_color; }
  2954. &:drop(active):not(:disabled) {
  2955. color: $drop_target_color;
  2956. box-shadow: inset 0 1px $drop_target_color,
  2957. inset 0 -1px $drop_target_color;
  2958. &:selected {
  2959. color: $selected_fg_color;
  2960. background-image: linear-gradient(to bottom,
  2961. darken(mix(darken($base_color, 10%), lighten($selected_bg_color, 35%), 0.1), 13%),
  2962. darken(mix(darken($base_color, 10%), lighten($selected_bg_color, 35%), 0.1), 5%) 10%,
  2963. darken(mix(darken($base_color, 10%), lighten($selected_bg_color, 35%), 0.1), 1%) 92%,
  2964. darken(mix(darken($base_color, 10%), lighten($selected_bg_color, 35%), 0.1), 8%)
  2965. );
  2966. }
  2967. }
  2968. }
  2969. }
  2970. placesview {
  2971. .server-list-button > image {
  2972. transition: 200ms $ease-out-quad;
  2973. -gtk-icon-transform: rotate(0turn);
  2974. }
  2975. .server-list-button:checked > image {
  2976. transition: 200ms $ease-out-quad;
  2977. -gtk-icon-transform: rotate(-0.5turn);
  2978. }
  2979. row.activatable:hover { background-color: transparent; }
  2980. // this selects the "connect to server" label
  2981. > actionbar > revealer > box > label {
  2982. padding-left: 8px;
  2983. padding-right: 8px;
  2984. }
  2985. }
  2986. /*********
  2987. * Paned *
  2988. *********/
  2989. paned {
  2990. > separator {
  2991. min-width: 1px;
  2992. min-height: 1px;
  2993. -gtk-icon-source: none; // defeats the ugly default handle decoration
  2994. border-style: none; // just to be sure
  2995. background-color: transparent;
  2996. // workaround, using background istead of a border since the border will get rendered twice (?)
  2997. background-image: image($borders_color);
  2998. background-size: 1px 1px;
  2999. &:selected { background-image: image($selected_bg_color); } // FIXME is this needed?
  3000. &:backdrop { background-image: image($backdrop_borders_color); }
  3001. &.wide {
  3002. min-width: 5px;
  3003. min-height: 5px;
  3004. background-color: $bg_color;
  3005. background-image: image($borders_color), image($borders_color);
  3006. background-size: 1px 1px, 1px 1px;
  3007. &:backdrop {
  3008. background-color: $backdrop_bg_color;
  3009. background-image: image($backdrop_borders_color),
  3010. image($backdrop_borders_color);
  3011. }
  3012. }
  3013. }
  3014. &.horizontal > separator {
  3015. background-repeat: repeat-y;
  3016. &:dir(ltr) {
  3017. margin: 0 -8px 0 0;
  3018. padding: 0 8px 0 0;
  3019. background-position: left;
  3020. }
  3021. &:dir(rtl) {
  3022. margin: 0 0 0 -8px;
  3023. padding: 0 0 0 8px;
  3024. background-position: right;
  3025. }
  3026. &.wide {
  3027. margin: 0;
  3028. padding: 0;
  3029. background-repeat: repeat-y, repeat-y;
  3030. background-position: left, right;
  3031. }
  3032. }
  3033. &.vertical > separator {
  3034. margin: 0 0 -8px 0;
  3035. padding: 0 0 8px 0;
  3036. background-repeat: repeat-x;
  3037. background-position: top;
  3038. &.wide {
  3039. margin: 0;
  3040. padding: 0;
  3041. background-repeat: repeat-x, repeat-x;
  3042. background-position: bottom, top;
  3043. }
  3044. }
  3045. }
  3046. /**************
  3047. * GtkInfoBar *
  3048. **************/
  3049. infobar { border-style: none; }
  3050. .info,
  3051. .question,
  3052. .warning,
  3053. .error {
  3054. &:backdrop, & {
  3055. label, & { color: $selected_fg_color; }
  3056. background-color: $selected_bg_color;
  3057. border-color: darken($selected_bg_color, 10%);
  3058. }
  3059. text-shadow: 0 1px darken($selected_bg_color, 10%);
  3060. &:backdrop { text-shadow: none; }
  3061. button {
  3062. // FIXME: extend selection mode buttons
  3063. @include button(normal, $selected_bg_color, $selected_fg_color, none);
  3064. border-color: darken($selected_bg_color, 20%);
  3065. &:hover { @include button(hover, $selected_bg_color, $selected_fg_color, none); }
  3066. &:active,
  3067. &:checked { @include button(active, $selected_bg_color, $selected_fg_color, none); }
  3068. &:disabled { @include button(insensitive,$selected_bg_color,$selected_fg_color,none); }
  3069. &:backdrop {
  3070. @include button(backdrop, $selected_bg_color, $selected_fg_color, none);
  3071. border-color: _border_color($selected_bg_color);
  3072. &:disabled {
  3073. @include button(backdrop-insensitive, $selected_bg_color,
  3074. $selected_fg_color, none);
  3075. border-color: _border_color($selected_bg_color);
  3076. }
  3077. }
  3078. }
  3079. label:selected { &:focus, &:hover, & { background-color: darken($selected_bg_color, 10%); }}
  3080. *:link { @extend %link_selected; }
  3081. }
  3082. /*************
  3083. * Buttonbox *
  3084. *************/
  3085. buttonbox {
  3086. padding: 6px;
  3087. }
  3088. /************
  3089. * Tooltips *
  3090. ************/
  3091. tooltip {
  3092. &.background {
  3093. // background-color needs to be set this way otherwise it gets drawn twice
  3094. // see https://bugzilla.gnome.org/show_bug.cgi?id=736155 for details.
  3095. background-color: transparentize(black, 0.2);
  3096. background-clip: padding-box;
  3097. border: 1px solid $tooltip_borders_color; // this suble border is meant to
  3098. // not make the tooltip melt with
  3099. // very dark backgrounds
  3100. }
  3101. padding: 1px; /* not working */
  3102. border-radius: 5px;
  3103. box-shadow: none; // otherwise it gets inherited by windowframe.csd
  3104. text-shadow: 0 1px black;
  3105. // FIXME: we need a border or tooltips vanish on black background.
  3106. decoration { background-color: transparent; }
  3107. * { // Yeah this is ugly
  3108. padding: 1px;
  3109. background-color: transparent;
  3110. color: white;
  3111. }
  3112. }
  3113. /*****************
  3114. * Color Chooser *
  3115. *****************/
  3116. colorswatch {
  3117. // This widget is made of two boxes one on top of the other, the lower box is colorswatch {} the other one
  3118. // is colorswatch overlay {}, colorswatch has the programmatically set background, so most of the style is
  3119. // applied to the overlay box.
  3120. &, &:drop(active) { border-style: none; } // FIXME: implement a proper drop(active) state
  3121. $_colorswatch_radius: 5px;
  3122. $_colorswatch_overlay_shadow: if($variant == 'light', inset 0 2px 2px -3px transparentize(black, 0.3),
  3123. inset 0 3px 2px -2px transparentize(black, 0.5));
  3124. // base color corners rounding
  3125. // to avoid the artifacts caused by rounded corner anti-aliasing the base color
  3126. // sports a bigger radius.
  3127. // nth-child is needed by the custom color strip.
  3128. &.top {
  3129. border-top-left-radius: $_colorswatch_radius + 0.5px;
  3130. border-top-right-radius: $_colorswatch_radius + 0.5px;
  3131. overlay {
  3132. border-top-left-radius: $_colorswatch_radius;
  3133. border-top-right-radius: $_colorswatch_radius;
  3134. }
  3135. }
  3136. &.bottom {
  3137. border-bottom-left-radius: $_colorswatch_radius + 0.5px;
  3138. border-bottom-right-radius: $_colorswatch_radius + 0.5px;
  3139. overlay {
  3140. border-bottom-left-radius: $_colorswatch_radius;
  3141. border-bottom-right-radius: $_colorswatch_radius;
  3142. }
  3143. }
  3144. &.left,
  3145. &:first-child:not(.top) {
  3146. border-top-left-radius: $_colorswatch_radius + 0.5px;
  3147. border-bottom-left-radius: $_colorswatch_radius + 0.5px;
  3148. overlay {
  3149. border-top-left-radius: $_colorswatch_radius;
  3150. border-bottom-left-radius: $_colorswatch_radius;
  3151. }
  3152. }
  3153. &.right,
  3154. &:last-child:not(.bottom) {
  3155. border-top-right-radius: $_colorswatch_radius + 0.5px;
  3156. border-bottom-right-radius: $_colorswatch_radius + 0.5px;
  3157. overlay {
  3158. border-top-right-radius: $_colorswatch_radius;
  3159. border-bottom-right-radius: $_colorswatch_radius;
  3160. }
  3161. }
  3162. &.dark overlay {
  3163. color: $selected_fg_color;
  3164. &:hover { border-color: if($variant == 'light', transparentize(black, 0.2), $borders_color); }
  3165. &:backdrop { color: $backdrop_selected_fg_color; }
  3166. }
  3167. &.light overlay {
  3168. color: $text_color;
  3169. &:hover { border-color: if($variant == 'light', transparentize(black, 0.5), $borders_color); }
  3170. &:backdrop { color: $backdrop_text_color; }
  3171. }
  3172. &:drop(active) {
  3173. box-shadow: none;
  3174. &.light overlay {
  3175. border-color: $drop_target_color;
  3176. box-shadow: inset 0 0 0 2px if($variant == 'light', darken($drop_target_color, 7%), $borders_color),
  3177. inset 0 0 0 1px $drop_target_color;
  3178. }
  3179. &.dark overlay {
  3180. border-color: $drop_target_color;
  3181. box-shadow: inset 0 0 0 2px if($variant == 'light', transparentize(black, 0.7), $borders_color),
  3182. inset 0 0 0 1px $drop_target_color;
  3183. }
  3184. }
  3185. overlay {
  3186. box-shadow: $_colorswatch_overlay_shadow;
  3187. border: 1px solid if($variant == 'light', transparentize(black, 0.7), $borders_color);
  3188. &:hover { box-shadow: inset 0 1px transparentize(white, 0.7); }
  3189. &:backdrop, &:backdrop:hover {
  3190. border-color: if($variant == 'light', transparentize(black, 0.7), $borders_color);
  3191. box-shadow: none;
  3192. }
  3193. }
  3194. &#add-color-button {
  3195. border-radius: $_colorswatch_radius $_colorswatch_radius 0 0;
  3196. &:only-child { border-radius: $_colorswatch_radius; }
  3197. overlay {
  3198. @include button(normal);
  3199. &:hover { @include button(hover); }
  3200. &:backdrop { @include button(backdrop); }
  3201. }
  3202. }
  3203. &:disabled {
  3204. opacity: 0.5;
  3205. overlay {
  3206. border-color: transparentize(black, 0.4);
  3207. box-shadow: none;
  3208. }
  3209. }
  3210. row:selected & { box-shadow: 0 0 0 2px $selected_fg_color; }
  3211. &#editor-color-sample {
  3212. border-radius: 4px;
  3213. overlay { border-radius: 4.5px; }
  3214. }
  3215. }
  3216. // colorscale popup
  3217. colorchooser .popover.osd { border-radius: 5px; }
  3218. /********
  3219. * Misc *
  3220. ********/
  3221. //content view (grid/list)
  3222. .content-view {
  3223. background-color: darken($bg_color,7%);
  3224. &:hover { -gtk-icon-effect: highlight; }
  3225. &:backdrop { background-color: darken($bg_color,7%); }
  3226. rubberband { @extend rubberband; }
  3227. }
  3228. .scale-popup {
  3229. .osd & { @extend %osd; }
  3230. .osd & button.flat { //FIXME: quick hack, redo properly
  3231. border-style: none;
  3232. border-radius: 5px;
  3233. }
  3234. button { // +/- buttons on GtkVolumeButton popup
  3235. &:hover {
  3236. @extend %undecorated_button;
  3237. background-color: transparentize($fg_color,0.9);
  3238. border-radius: 5px;
  3239. }
  3240. &:backdrop { &:hover, &:disabled, & { @extend %undecorated_button; }}
  3241. }
  3242. }
  3243. /**********************
  3244. * Window Decorations *
  3245. *********************/
  3246. decoration {
  3247. border-radius: 7px 7px 0 0;
  3248. // lamefun trick to get rounded borders regardless of CSD use
  3249. border-width: 0px;
  3250. // this needs to be transparent
  3251. // see bug #722563
  3252. $_wm_border: if($variant=='light', transparentize(black, 0.77), transparentize($borders_color, 0.1));
  3253. $_wm_border_backdrop: if($variant=='light', transparentize(black, 0.82), transparentize($borders_color, 0.1));
  3254. box-shadow: 0 3px 9px 1px transparentize(black, 0.5),
  3255. 0 0 0 1px $_wm_border; //doing borders with box-shadow
  3256. // FIXME rationalize shadows
  3257. // this is used for the resize cursor area
  3258. margin: 10px;
  3259. &:backdrop {
  3260. // the transparent shadow here is to enforce that the shadow extents don't
  3261. // change when we go to backdrop, to prevent jumping windows.
  3262. // The biggest shadow should be in the same order then in the active state
  3263. // or the jumping will happen during the transition.
  3264. box-shadow: 0 3px 9px 1px transparent,
  3265. 0 2px 6px 2px transparentize(black, 0.8),
  3266. 0 0 0 1px $_wm_border_backdrop;
  3267. transition: $backdrop_transition;
  3268. }
  3269. .maximized &,
  3270. .fullscreen &,
  3271. .tiled & { border-radius: 0; }
  3272. .popup & { box-shadow: none; }
  3273. // server-side decorations as used by mutter
  3274. .ssd & { box-shadow: 0 0 0 1px $_wm_border; } //just doing borders, wm draws actual shadows
  3275. .csd.popup & {
  3276. border-radius: 0;
  3277. box-shadow: 0 1px 2px transparentize(black, 0.8),
  3278. 0 0 0 1px transparentize($_wm_border,0.1);
  3279. }
  3280. tooltip.csd & {
  3281. border-radius: 5px;
  3282. box-shadow: none;
  3283. }
  3284. messagedialog.csd & {
  3285. border-radius: 7px;
  3286. box-shadow: 0 1px 2px transparentize(black, 0.8),
  3287. 0 0 0 1px transparentize($_wm_border,0.1);
  3288. }
  3289. .solid-csd & {
  3290. border-radius: 0;
  3291. margin: 4px;
  3292. background-color: $backdrop_bg_color;
  3293. border: solid 1px $backdrop_borders_color;
  3294. box-shadow: none;
  3295. }
  3296. }
  3297. // Window buttons
  3298. button.titlebutton {
  3299. @extend %button_basic;
  3300. @extend %button_basic.flat;
  3301. @include _button_text_shadow;
  3302. &.close, &.maximize, &.minimize {
  3303. color: transparent;
  3304. background-color: transparent;
  3305. background-position: center;
  3306. background-repeat: no-repeat;
  3307. // fade the png buttons out on unfocused windows
  3308. &:backdrop { opacity: 0.5; }
  3309. }
  3310. // Load png assets for each button
  3311. @each $k in ('close','maximize', 'minimize') {
  3312. @each $l, $m in ('',''), (':backdrop','-backdrop'), (':hover','-hover'), (':active','-active') {
  3313. &.#{$k}#{$l} { background-image: -gtk-scaled(url('assets/titlebutton-#{$k}#{$m}#{$asset_suffix}.png'),
  3314. url('assets/titlebutton-#{$k}#{$m}#{$asset_suffix}@2.png')); }
  3315. }
  3316. }
  3317. .selection-mode & {
  3318. @extend %button.flat.suggested-action;
  3319. @extend %nobg_selected_items;
  3320. }
  3321. &:backdrop { -gtk-icon-shadow: none; }
  3322. }
  3323. headerbar.selection-mode button.titlebutton,
  3324. .titlebar.selection-mode button.titlebutton {
  3325. @include _button_text_shadow(white, $selected_bg_color);
  3326. &:backdrop { -gtk-icon-shadow: none; }
  3327. }
  3328. // catch all extend :)
  3329. %selected_items {
  3330. background-color: $selected_bg_color;
  3331. @at-root %nobg_selected_items, & {
  3332. color: $selected_fg_color;
  3333. @if $variant == 'light' { outline-color: transparentize($selected_fg_color, 0.7); }
  3334. &:disabled { color: mix($selected_fg_color, $selected_bg_color, 50%); }
  3335. &:backdrop {
  3336. color: $backdrop_selected_fg_color;
  3337. &:disabled { color: mix($backdrop_selected_fg_color, $selected_bg_color, 30%); }
  3338. }
  3339. }
  3340. }
  3341. .monospace { font-family: monospace; }
  3342. /**********************
  3343. * Touch Copy & Paste *
  3344. *********************/
  3345. //touch selection handlebars for the Popover.osd above
  3346. cursor-handle {
  3347. background-color: transparent;
  3348. background-image: none;
  3349. box-shadow: none;
  3350. border-style: none;
  3351. @each $s,$as in ('',''),
  3352. (':hover','-hover'),
  3353. (':active','-active') { //no need for insensitive and backdrop
  3354. &.top#{$s}:dir(ltr), &.bottom#{$s}:dir(rtl) {
  3355. $_url: 'assets/text-select-start#{$as}#{$asset_suffix}';
  3356. -gtk-icon-source: -gtk-scaled(url('#{$_url}.png'),
  3357. url('#{$_url}@2.png'));
  3358. padding-left: 10px;
  3359. }
  3360. &.bottom#{$s}:dir(ltr), &.top#{$s}:dir(rtl) {
  3361. $_url: 'assets/text-select-end#{$as}#{$asset_suffix}';
  3362. -gtk-icon-source: -gtk-scaled(url('#{$_url}.png'),
  3363. url('#{$_url}@2.png'));
  3364. padding-right: 10px;
  3365. }
  3366. &.insertion-cursor#{$s}:dir(ltr), &.insertion-cursor#{$s}:dir(rtl) {
  3367. $_url: 'assets/slider-horz-scale-has-marks-above#{$as}#{$asset_suffix}';
  3368. -gtk-icon-source: -gtk-scaled(url('#{$_url}.png'),
  3369. url('#{$_url}@2.png'));
  3370. }
  3371. }
  3372. }
  3373. .context-menu { font: initial; } // Decouple the font of context menus from their entry/textview
  3374. button.circular { // FIXME: aggregate to buttons
  3375. border-radius: 9999px;
  3376. -gtk-outline-radius: 9999px;
  3377. label { padding: 0; }
  3378. }
  3379. // shortcut window keys
  3380. .keycap {
  3381. min-width: 20px;
  3382. min-height: 25px;
  3383. margin-top: 2px;
  3384. padding-bottom: 3px;
  3385. padding-left: 6px;
  3386. padding-right: 6px;
  3387. color: $fg_color;
  3388. background-color: $base_color;
  3389. border: 1px solid;
  3390. border-color: if($variant == 'light', mix($borders_color, $bg_color, 50%), $borders_color);
  3391. border-radius: 5px;
  3392. box-shadow: if($variant == 'light', inset 0 -3px mix($base_color, $bg_color, 20%), inset 0 -3px mix($borders_color, $base_color, 60%));
  3393. font-size: smaller;
  3394. &:backdrop {
  3395. background-color: $backdrop_base_color;
  3396. color: $backdrop_fg_color;
  3397. transition: $backdrop_transition;
  3398. }
  3399. }
  3400. :not(decoration):not(window):drop(active):focus,
  3401. :not(decoration):not(window):drop(active) { // FIXME needs to be done widget by widget, this wildcard should really die
  3402. border-color: $drop_target_color;
  3403. box-shadow: inset 0 0 0 1px $drop_target_color;
  3404. }
  3405. stackswitcher button.text-button { min-width: 100px; } // FIXME aggregate with buttons
  3406. stackswitcher button.circular,
  3407. stackswitcher button.text-button.circular { // FIXME aggregate with buttons
  3408. min-width: 32px;
  3409. min-height: 32px;
  3410. padding: 0;
  3411. }