12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385 |
- @function gtkalpha($c,$a) {
- @return unquote("alpha(#{$c},#{$a})");
- }
- $ease-out-quad: cubic-bezier(0.25, 0.46, 0.45, 0.94);
- $asset_suffix: if($variant=='dark', '-dark', '');
- $backdrop_transition: 200ms ease-out;
- $button_transition: all 200ms $ease-out-quad;
- * {
- padding: 0;
- -GtkToolButton-icon-spacing: 4;
- -GtkTextView-error-underline-color: $error_color;
- // The size for scrollbars. The slider is 2px smaller, but we keep it
- // up so that the whole area is sensitive to button presses for the
- // slider. The stepper button is larger in both directions, the slider
- // only in the width
- -GtkScrolledWindow-scrollbar-spacing: 0;
- -GtkToolItemGroup-expander-size: 11;
- -GtkWidget-text-handle-width: 20;
- -GtkWidget-text-handle-height: 24;
- -GtkDialog-button-spacing: 4;
- -GtkDialog-action-area-border: 0;
- // We use the outline properties to signal the focus properties
- // to the adwaita engine: using real CSS properties is faster,
- // and we don't use any outlines for now.
- outline-color: transparentize($fg_color, 0.7);
- outline-style: dashed;
- outline-offset: -3px;
- outline-width: 1px;
- -gtk-outline-radius: 2px;
- -gtk-secondary-caret-color: $selected_bg_color
- }
- /***************
- * Base States *
- ***************/
- .background {
- color: $fg_color;
- background-color: $bg_color;
- &:backdrop {
- color: $backdrop_fg_color;
- background-color: $backdrop_bg_color;
- text-shadow: none;
- -gtk-icon-shadow: none;
- }
- }
- /*
- These wildcard seems unavoidable, need to investigate.
- Wildcards are bad and troublesome, use them with care,
- or better, just don't.
- Everytime a wildcard is used a kitten dies, painfully.
- */
- *:disabled { -gtk-icon-effect: dim; }
- .gtkstyle-fallback {
- color: $fg_color;
- background-color: $bg_color;
- text-shadow: none;
- &:hover {
- color: $fg_color;
- background-color: lighten($bg_color, 10%);
- }
- &:active {
- color: $fg_color;
- background-color: darken($bg_color, 10%);
- }
- &:disabled {
- color: $insensitive_fg_color;
- background-color: $insensitive_bg_color;
- }
- &:selected {
- color: $selected_fg_color;
- background-color: $selected_bg_color;
- }
- }
- .view,
- %view {
- color: $text_color;
- background-color: $base_color;
- &:backdrop {
- color: $backdrop_text_color;
- background-color: $backdrop_base_color;
- }
- &:selected {
- &:focus, & {
- @extend %selected_items;
- border-radius: 3px;
- }
- }
- }
- .view,
- textview {
- text {
- @extend %view;
- selection { &:focus, & { @extend %selected_items; }}
- }
- }
- textview border { background-color: mix($bg_color, $base_color, 50%); }
- iconview { @extend .view; }
- .rubberband,
- rubberband {
- border: 1px solid darken($selected_bg_color, 10%);
- background-color: transparentize(darken($selected_bg_color, 10%), 0.8);
- }
- flowbox {
- rubberband { @extend rubberband; }
- flowboxchild {
- padding: 3px;
- border-radius: 3px;
- &:selected {
- @extend %selected_items;
- outline-offset: -2px;
- }
- }
- }
- label {
- &.separator {
- @extend .dim-label;
- color: $fg_color;
- &:backdrop { color: $backdrop_fg_color; }
- }
- row:selected &,
- &:selected { @extend %nobg_selected_items; }
- selection {
- background-color: $selected_bg_color;
- color: $selected_fg_color;
- }
- &:disabled {
- color: $insensitive_fg_color;
- selection { @extend %selected_items:disabled; }
- &:backdrop { color: $backdrop_insensitive_color; }
- }
- &:backdrop {
- color: $backdrop_fg_color;
- selection { @extend %selected_items:backdrop; }
- }
- }
- .dim-label {
- opacity: 0.55;
- text-shadow: none;
- }
- assistant {
- .sidebar {
- background-color: $base_color;
- border-top: 1px solid $borders_color;
- &:backdrop {
- background-color: $backdrop_base_color;
- border-color: $backdrop_borders_color;
- }
- }
- &.csd .sidebar { border-top-style: none; }
- .sidebar label { padding: 6px 12px; }
- .sidebar label.highlight { background-color: mix($bg_color, $fg_color, 80%); }
- }
- %osd, .osd {
- color: $osd_fg_color;
- border: none;
- background-color: $osd_bg_color;
- background-clip: padding-box;
- outline-color: transparentize($osd_fg_color, 0.7);
- text-shadow: 0 1px black;
- -gtk-icon-shadow: 0 1px black;
- &:backdrop {
- color: shade($osd_fg_color, 1.2);
- background-color: shade($osd_bg_color, 1.6);
- text-shadow: none;
- -gtk-icon-shadow: none;
- }
- }
- /*********************
- * Spinner Animation *
- *********************/
- @keyframes spin {
- to { -gtk-icon-transform: rotate(1turn); }
- }
- spinner {
- background: none;
- opacity: 0; // non spinning spinner makes no sense
- -gtk-icon-source: -gtk-icontheme('process-working-symbolic');
- &:checked {
- opacity: 1;
- animation: spin 1s linear infinite;
- &:disabled { opacity: 0.5; }
- }
- }
- /****************
- * Text Entries *
- ****************/
- %entry,
- entry {
- %entry_basic, & {
- min-height: 28px;
- padding-left: 4px;
- padding-right: 4px;
- border: 1px solid;
- border-radius: 3px;
- transition: all 200ms $ease-out-quad;
- @include entry(normal);
- image { // icons inside the entry
- &.left { margin-right: 6px; }
- &.right { margin-left: 6px; }
- }
- undershoot {
- &.left { @include undershoot(left); }
- &.right { @include undershoot(right); }
- }
- &.flat {
- &:focus, & {
- min-height: 0;
- padding: 2px;
- background-color: transparent;
- border-color: transparent;
- border-radius: 0;
- }
- }
- &:focus { @include entry(focus); }
- &:disabled { @include entry(insensitive); }
- &:backdrop {
- @include entry(backdrop);
- transition: $backdrop_transition;
- }
- &:backdrop:disabled { @include entry(backdrop-insensitive); }
- selection { &:focus, & { @extend %selected_items; }}
- // entry error and warning style
- @each $e_type, $e_color in (error, $error_color),
- (warning, $warning_color) {
- &.#{$e_type} {
- background-color: transparentize($e_color, 0.9);
- color: $e_color;
- border-color: entry_focus_border($e_color);
- &:focus { @include entry(focus, $e_color); }
- selection { background-color: $e_color; }
- }
- }
- image { // entry icons colors
- color: mix($fg_color, $base_color, 80%);
- &:hover { color: $fg_color; }
- &:active { color: $selected_bg_color; }
- &:backdrop { color: mix($backdrop_fg_color, $backdrop_base_color, 80%); }
- }
- &:drop(active) {
- &:focus, & {
- border-color: $drop_target_color;
- box-shadow: inset 0 0 0 1px $drop_target_color;
- }
- }
- .osd & {
- @include entry(osd);
- &:focus { @include entry(osd-focus); }
- &:backdrop { @include entry(osd-backdrop); }
- &:disabled { @include entry(osd-insensitive); }
- }
- }
- progress {
- margin: 2px -6px;
- background-color: transparent;
- background-image: none;
- border-radius: 0;
- border-width: 0 0 2px;
- border-color: $selected_bg_color;
- border-style: solid;
- box-shadow: none;
- &:backdrop { background-color: transparent; }
- }
- // linked entries
- .linked:not(.vertical) > & { @extend %linked; }
- .linked:not(.vertical) > &:focus + &,
- .linked:not(.vertical) > &:focus + button,
- .linked:not(.vertical) > &:focus + combobox > box > button.combo { border-left-color: entry_focus_border(); }
- .linked:not(.vertical) > &:drop(active) + &,
- .linked:not(.vertical) > &:drop(active) + button,
- .linked:not(.vertical) > &:drop(active) + combobox > box > button.combo { border-left-color: $drop_target_color; }
- // Vertically linked entries
- // FIXME: take care of "colored" entries
- .linked.vertical > & {
- @extend %linked_vertical;
- // brighter border between linked entries
- &:not(:disabled) + entry:not(:disabled),
- &:not(:disabled) + %entry:not(:disabled) {
- border-top-color: mix($borders_color, $base_color, 30%);
- background-color: $base_color;
- &:backdrop {
- border-top-color: mix($backdrop_borders_color, $backdrop_base_color, 30%);
- background-color: $backdrop_base_color;
- }
- }
- // brighter border between linked insensitive entries
- &:disabled + %entry:disabled,
- &:disabled + entry:disabled { border-top-color: mix($borders_color, $base_color, 30%); }
- // color back the top border of a linked focused entry following another entry and add back the focus shadow.
- // :not(:only-child) is a specificity bump hack.
- + %entry:focus:not(:only-child),
- + entry:focus:not(:only-child) { border-top-color: entry_focus_border(); }
- + %entry:drop(active):not(:only-child),
- + entry:drop(active):not(:only-child) { border-top-color: $drop_target_color; }
- // this takes care of coloring the top border of the focused entry subsequent widget.
- // :not(:only-child) is a specificity bump hack.
- &:focus:not(:only-child) {
- + %entry,
- + entry,
- + button,
- + combobox > box > button.combo { border-top-color: entry_focus_border(); }
- }
- &:drop(active):not(:only-child) {
- + %entry,
- + entry,
- + button,
- + combobox > box > button.combo { border-top-color: $drop_target_color; }
- }
- }
- }
- treeview entry {
- &:focus {
- &:dir(rtl), &:dir(ltr) { // specificity bump hack
- background-color: $base_color;
- transition-property: color, background;
- }
- }
- &.flat, & {
- border-radius: 0;
- background-image: none;
- background-color: $base_color;
- &:focus { border-color: $selected_bg_color; }
- }
- }
- /***********
- * Buttons *
- ***********/
- // stuff for .needs-attention
- $_dot_color: if($variant=='light', $selected_bg_color,
- lighten($selected_bg_color,15%));
- @keyframes needs_attention {
- from {
- background-image: -gtk-gradient(radial,
- center center, 0,
- center center, 0.01,
- to($_dot_color),
- to(transparent));
- }
- to {
- background-image: -gtk-gradient(radial,
- center center, 0,
- center center, 0.5,
- to($selected_bg_color),
- to(transparent));
- }
- }
- %button,
- button {
- @at-root %button_basic, & {
- min-height: 24px;
- min-width: 16px;
- padding: 1px 2px;
- border: 1px solid;
- border-radius: 3px;
- transition: $button_transition;
- @include button(normal);
- &.flat {
- @include button(undecorated);
- // to avoid adiacent buttons borders clashing when transitioning, the transition on the normal state is set
- // to none, while it's added back in the hover state, so the button decoration will fade in on hover, but
- // it won't fade out when the pointer leave the button allocation area. To make the transition more evident
- // in this case the duration is increased.
- transition: none;
- &:hover {
- transition: $button_transition;
- transition-duration: 500ms;
- &:active { transition: $button_transition; }
- }
- }
- &:hover {
- @include button(hover);
- -gtk-icon-effect: highlight;
- }
- &:active,
- &:checked {
- @include button(active);
- transition-duration: 50ms;
- }
- &:backdrop {
- &.flat, & {
- @include button(backdrop);
- transition: $backdrop_transition;
- -gtk-icon-effect: none;
- &:active,
- &:checked { @include button(backdrop-active); }
- &:disabled {
- @include button(backdrop-insensitive);
- &:active,
- &:checked { @include button(backdrop-insensitive-active); }
- }
- }
- }
- &.flat { &:backdrop, &:disabled, &:backdrop:disabled { @include button(undecorated); }}
- &:disabled {
- @include button(insensitive);
- &:active,
- &:checked { @include button(insensitive-active); }
- }
- &.image-button {
- min-width: 24px;
- padding-left: 4px;
- padding-right: 4px;
- }
- &.text-button {
- padding-left: 8px;
- padding-right: 8px;
- }
- &.text-button.image-button {
- padding-left: 4px;
- padding-right: 4px;
- label {
- padding-left: 4px;
- padding-right: 4px;
- }
- }
- &:drop(active) {
- color: $drop_target_color;
- border-color: $drop_target_color;
- box-shadow: inset 0 0 0 1px $drop_target_color;
- }
- }
- @at-root %button_selected, & {
- row:selected & {
- @if $variant == 'light' { border-color: $selected_borders_color; }
- &.flat:not(:active):not(:checked):not(:hover):not(disabled) {
- color: $selected_fg_color;
- border-color: transparent;
- &:backdrop { color: if($variant=='light', $backdrop_base_color, $backdrop_fg_color); }
- }
- }
- }
- // big standalone buttons like in Documents pager
- &.osd {
- min-width: 24px;
- min-height: 32px;
- &.image-button { min-width: 32px; }
- color: $osd_fg_color;
- border-radius: 5px;
- outline-color: transparentize($osd_fg_color, 0.7); //FIXME: define a color var?
- @include button(osd);
- border: none;
- box-shadow: none;
- &:hover {
- @include button(osd-hover);
- border: none;
- box-shadow: none;
- }
- &:active,
- &:checked {
- @include button(osd-active);
- border: none;
- box-shadow: none;
- }
- &:disabled {
- &:backdrop, & {
- @include button(osd-insensitive);
- border: none;
- }
- }
- &:backdrop {
- @include button(osd-backdrop);
- border: none;
- }
- }
- //overlay / OSD style
- @at-root %osd_button,
- .osd & {
- @include button(osd);
- &:hover { @include button(osd-hover); }
- &:active,
- &:checked { &:backdrop, & { @include button(osd-active); }}
- &:disabled { &:backdrop, & { @include button(osd-insensitive); }}
- &:backdrop { @include button(osd-backdrop); }
- &.flat {
- @include button(undecorated);
- box-shadow: none; //FIXME respect no edge on the button mixin
- text-shadow: 0 1px black;
- -gtk-icon-shadow: 0 1px black;
- &:hover { @include button(osd-hover); }
- &:disabled {
- @include button(osd-insensitive);
- background-image: none;
- border-color: transparent;
- box-shadow: none;
- }
- &:backdrop { @include button(undecorated); }
- &:active,
- &:checked { @include button(osd-active); }
- }
- }
- // Suggested and Destructive Action buttons
- @each $b_type, $b_color in (suggested-action, $selected_bg_color),
- (destructive-action, $destructive_color) {
- &.#{$b_type} {
- @include button(normal, $b_color, white);
- &.flat {
- @include button(undecorated);
- color: $b_color; //FIXME: does it work on the dark variant?
- }
- &:hover { @include button(hover, $b_color, white); }
- &:active,
- &:checked { @include button(active, $b_color, white); }
- &:backdrop,
- &.flat:backdrop {
- @include button(backdrop, $b_color, white);
- &:active,
- &:checked { @include button(backdrop-active, $b_color, white); }
- &:disabled {
- @include button(backdrop-insensitive);
- &:active,
- &:checked { @include button(backdrop-insensitive-active, $b_color, white); }
- }
- }
- &.flat {
- &:backdrop, &:disabled, &:backdrop:disabled {
- @include button(undecorated);
- color: transparentize($b_color, 0.2);
- }
- }
- &:disabled {
- @include button(insensitive, $b_color, white);
- &:active,
- &:checked { @include button(insensitive-active, $b_color, white); }
- }
- .osd & {
- @include button(osd, $b_color);
- &:hover { @include button(osd-hover, $b_color); }
- &:active,
- &:checked { &:backdrop, & { @include button(osd-active, $b_color); }}
- &:disabled { &:backdrop, & { @include button(osd-insensitive, $b_color); }}
- &:backdrop { @include button(osd-backdrop, $b_color); }
- }
- }
- }
- .stack-switcher > & {
- // to position the needs attention dot, padding is added to the button
- // child, a label needs just lateral padding while an icon needs vertical
- // padding added too.
- outline-offset: -3px; // needs to be set or it gets overriden by GtkRadioButton outline-offset
- > label {
- padding-left: 6px; // label padding
- padding-right: 6px; //
- }
- > image {
- padding-left: 6px; // image padding
- padding-right: 6px; //
- padding-top: 3px; //
- padding-bottom: 3px; //
- }
- &.text-button {
- // compensate text-button paddings
- padding-left: 10px;
- padding-right: 10px;
- }
- &.image-button {
- // we want image buttons to have a 1:1 aspect ratio, so compensation
- // of the padding added to the GtkImage is needed
- padding-left: 2px;
- padding-right: 2px;
- }
- &.needs-attention {
- > label,
- > image { @extend %needs_attention; }
- &:active,
- &:checked {
- > label,
- > image {
- animation: none;
- background-image: none;
- }
- }
- }
- }
- //inline-toolbar buttons
- .inline-toolbar &, .inline-toolbar &:backdrop {
- border-radius: 2px;
- border-width: 1px;
- @extend %linked;
- }
- .primary-toolbar & { -gtk-icon-shadow: none; } // tango icons don't need shadows
- .linked > &,
- .linked > &:hover,
- .linked > &:active,
- .linked > &:checked,
- .linked > &:backdrop { @extend %linked; }
- .linked.vertical > &,
- .linked.vertical > &:hover,
- .linked.vertical > &:active,
- .linked.vertical > &:checked,
- .linked.vertical > &:backdrop { @extend %linked_vertical; }
- }
- %needs_attention {
- animation: needs_attention 150ms ease-in;
- $_dot_shadow: _text_shadow_color();
- $_dot_shadow_r: if($variant=='light',0.5,0.45);
- background-image: -gtk-gradient(radial,
- center center, 0,
- center center, 0.5,
- to($_dot_color),
- to(transparent)),
- -gtk-gradient(radial,
- center center, 0,
- center center, $_dot_shadow_r,
- to($_dot_shadow),
- to(transparent));
- background-size: 6px 6px, 6px 6px;
- background-repeat: no-repeat;
- @if $variant == 'light' { background-position: right 3px, right 4px; }
- @else { background-position: right 3px, right 2px; }
- &:backdrop { background-size: 6px 6px, 0 0;}
- &:dir(rtl) {
- @if $variant == 'light' { background-position: left 3px, left 4px; }
- @else { background-position: left 3px, left 2px; }
- }
- }
- // all the following is for the +|- buttons on inline toolbars, that way
- // should really be deprecated...
- .inline-toolbar toolbutton > button { // redefining the button look is
- // needed since those are flat...
- @include button(normal);
- &:hover { @include button(hover); }
- &:active,
- &:checked{ @include button(active); }
- &:disabled {
- @include button(insensitive);
- &:active,
- &:checked { @include button(insensitive-active); }
- }
- &:backdrop {
- @include button(backdrop);
- &:active,
- &:checked { @include button(backdrop-active); }
- &:disabled {
- @include button(backdrop-insensitive);
- &:active,
- &:checked { @include button(backdrop-insensitive-active); }
- }
- }
- }
- // More inline toolbar buttons
- toolbar.inline-toolbar toolbutton,
- toolbar.inline-toolbar toolbutton:backdrop {
- > button.flat { @extend %linked_middle; }
- &:first-child > button.flat { @extend %linked:first-child; }
- &:last-child > button.flat { @extend %linked:last-child; }
- &:only-child > button.flat { @extend %linked:only-child; }
- }
- %linked_middle {
- border-radius: 0;
- border-right-style: none;
- }
- %linked {
- @extend %linked_middle;
- &:first-child {
- border-top-left-radius: 3px;
- border-bottom-left-radius: 3px;
- }
- &:last-child {
- border-top-right-radius: 3px;
- border-bottom-right-radius: 3px;
- border-right-style: solid;
- }
- &:only-child {
- border-radius: 3px;
- border-style: solid;
- }
- }
- %linked_vertical_middle {
- border-style: solid solid none solid;
- border-radius: 0;
- }
- %linked_vertical{
- @extend %linked_vertical_middle;
- &:first-child {
- border-top-left-radius: 3px;
- border-top-right-radius: 3px;
- }
- &:last-child {
- border-bottom-left-radius: 3px;
- border-bottom-right-radius: 3px;
- border-style: solid;
- }
- &:only-child {
- border-radius: 3px;
- border-style: solid;
- }
- }
- %undecorated_button {
- background-color: transparent;
- background-image: none;
- border-color: transparent;
- box-shadow: inset 0 1px transparentize(white, 1),
- 0 1px transparentize(white, 1);
- text-shadow: none;
- -gtk-icon-shadow: none;
- }
- /* menu buttons */
- modelbutton.flat,
- .menuitem.button.flat {
- min-height: 26px;
- padding-left: 5px;
- padding-right: 5px;
- border-radius: 3px;
- outline-offset: -2px;
- @extend %undecorated_button;
- &:hover { background-color: $popover_hover_color; }
- &:selected { @extend %selected_items; }
- &:backdrop,
- &:backdrop:hover { @extend %undecorated_button; }
- // FIXME: remove the following when the checks/radios rewrite lands
- check:last-child,
- radio:last-child { margin-left: 8px; }
- check:first-child,
- radio:first-child { margin-right: 8px; }
- }
- modelbutton.flat arrow {
- background: none;
- &:hover { background: none; }
- &.left { -gtk-icon-source: -gtk-icontheme("pan-start-symbolic"); }
- &.right { -gtk-icon-source: -gtk-icontheme("pan-end-symbolic"); }
- }
- button.color {
- padding: 4px;
- colorswatch:only-child {
- &, overlay { border-radius: 0; }
- @if $variant == 'light' {
- box-shadow: 0 1px _text_shadow_color();
- &:disabled,
- &:backdrop,
- &:active,
- &:checked { colorswatch:only-child { box-shadow: none; }}
- }
- }
- }
- /*********
- * Links *
- *********/
- *:link {
- color: $link_color;
- &:visited {
- color: $link_visited_color;
- *:selected & { color: mix($selected_fg_color, $selected_bg_color, 60%); }
- }
- &:hover {
- color: lighten($link_color,10%);
- *:selected & { color: mix($selected_fg_color, $selected_bg_color, 90%); }
- }
- &:active {
- color: $link_color;
- *:selected & { color: mix($selected_fg_color, $selected_bg_color, 80%); }
- }
- &:backdrop { &:backdrop:hover, &:backdrop:hover:selected, & { color: $selected_bg_color; }}
- @at-root %link_selected,
- &:selected,
- *:selected & { color: mix($selected_fg_color, $selected_bg_color, 80%); }
- }
- button:link,
- button:visited {
- @extend %undecorated_button;
- @extend *:link;
- text-shadow: none;
- &:hover,
- &:active,
- &:checked {
- @extend %undecorated_button;
- text-shadow: none;
- }
- > label { text-decoration-line: underline; }
- }
- /*****************
- * GtkSpinButton *
- *****************/
- spinbutton {
- &:not(.vertical) {
- // in this horizontal configuration, the whole spinbutton
- // behaves as the entry, so we extend the entry styling
- // and nuke the style on the internal entry
- @extend %entry;
- padding: 0;
- entry {
- min-width: 28px;
- // reset all the other props since the spinbutton node is styled here
- margin: 0;
- background: none;
- background-color: transparent;
- border: none;
- border-radius: 0;
- box-shadow: none;
- }
- button {
- min-height: 16px;
- margin: 0;
- padding-bottom: 0;
- padding-top: 0;
- color: mix($fg_color, $base_color, 90%);
- background-image: none;
- border-style: none none none solid;
- border-color: transparentize($borders_color, 0.7);
- border-radius: 0;
- box-shadow: none;
- &:dir(rtl) { border-style: none solid none none; }
- &:hover {
- color: $fg_color;
- background-color: $base_hover_color;
- }
- &:disabled {
- color: transparentize($insensitive_fg_color, 0.7);
- background-color: transparent;
- }
- &:active {
- background-color: transparentize(black, 0.9);
- box-shadow: inset 0 2px 3px -1px transparentize(black, 0.8);
- }
- &:backdrop {
- color: mix($backdrop_fg_color, $backdrop_base_color, 90%);
- background-color: transparent;
- border-color: transparentize($backdrop_borders_color, 0.7);
- transition: $backdrop_transition;
- }
- &:backdrop:disabled {
- color: transparentize($backdrop_insensitive_color,0.7);
- background-color: transparent;
- border-style: none none none solid; // It is needed or it gets overridden
- &:dir(rtl) { border-style: none solid none none; }
- }
- }
- }
- // OSD horizontal
- .osd &:not(.vertical) {
- button {
- @include button(undecorated);
- color: $osd_fg_color;
- border-style: none none none solid;
- border-color: transparentize($osd_borders_color, 0.3);
- border-radius: 0;
- box-shadow: none;
- -gtk-icon-shadow: 0 1px black;
- &:dir(rtl) { border-style: none solid none none; }
- &:hover {
- @include button(undecorated);
- color: $osd_fg_color;
- border-color: transparentize(opacify($osd_borders_color, 1), 0.5);
- background-color: transparentize($osd_fg_color, 0.9);
- -gtk-icon-shadow: 0 1px black;
- box-shadow: none;
- }
- &:backdrop {
- @include button(undecorated);
- color: $osd_fg_color;
- border-color: transparentize(opacify($osd_borders_color, 1), 0.5);
- -gtk-icon-shadow: none;
- box-shadow: none;
- }
- &:disabled {
- @include button(undecorated);
- color: $osd_insensitive_fg_color;
- border-color: transparentize(opacify($osd_borders_color, 1), 0.5);
- -gtk-icon-shadow: none;
- box-shadow: none;
- }
- &:dir(ltr):last-child { border-radius: 0 3px 3px 0; }
- &:dir(rtl):first-child { border-radius: 3px 0 0 3px; }
- }
- }
- // Vertical
- &.vertical {
- // in the vertical configuration, we treat the spinbutton
- // as a box, and tweak the style of the entry in the middle
- // so that it's linked
- // FIXME: this should not be set at all, but otherwise it gets the wrong
- // color
- &:disabled { color: $insensitive_fg_color; }
- &:backdrop:disabled { color: $backdrop_insensitive_color; }
- &:drop(active) {
- border-color: transparent;
- box-shadow: none;
- }
- entry {
- min-height: 32px;
- min-width: 32px;
- padding: 0;
- border-radius: 0;
- }
- button {
- min-height: 32px;
- min-width: 32px;
- padding: 0;
- &.up { @extend %top_button; }
- &.down { @extend %bottom_button; }
- }
- %top_button {
- border-radius: 3px 3px 0 0;
- border-style: solid solid none solid;
- }
- %bottom_button {
- border-radius: 0 0 3px 3px;
- border-style: none solid solid solid;
- }
- }
- // OSD vertical
- .osd &.vertical button:first-child {
- @include button(osd);
- &:hover { @include button(osd-hover);}
- &:active { @include button(osd-active); }
- &:disabled { @include button(osd-insensitive); }
- &:backdrop { @include button(osd-backdrop); }
- }
- // Misc
- treeview &:not(.vertical) {
- min-height: 0;
- border-style: none;
- border-radius: 0;
- entry {
- min-height: 0;
- padding: 1px 2px;
- }
- }
- }
- /**************
- * ComboBoxes *
- **************/
- combobox {
- arrow {
- -gtk-icon-source: -gtk-icontheme('pan-down-symbolic');
- min-height: 16px;
- min-width: 16px;
- }
- &.linked {
- button:nth-child(2) {
- &:dir(ltr) { @extend %linked:last-child; }
- &:dir(rtl) { @extend %linked:first-child; }
- }
- }
- &:drop(active) { // FIXME: untested
- box-shadow: none;
- button.combo { @extend %button_basic:drop(active); }
- }
- }
- .linked > combobox > box > button.combo {
- // the combo is a composite widget so the way we do button linking doesn't
- // work, special case needed. See
- // https://bugzilla.gnome.org/show_bug.cgi?id=733979
- &:dir(ltr),
- &:dir(rtl) { @extend %linked_middle; } // specificity bump
- }
- .linked:not(.vertical) > combobox:first-child > box > button.combo { @extend %linked:first-child; }
- .linked:not(.vertical) > combobox:last-child > box > button.combo { @extend %linked:last-child; }
- .linked:not(.vertical) > combobox:only-child > box > button.combo { @extend %linked:only-child; }
- .linked.vertical > combobox > box > button.combo { @extend %linked_vertical_middle; }
- .linked.vertical > combobox:first-child > box > button.combo { @extend %linked_vertical:first-child;}
- .linked.vertical > combobox:last-child > box > button.combo { @extend %linked_vertical:last-child; }
- .linked.vertical > combobox:only-child > box > button.combo { @extend %linked_vertical:only-child; }
- /************
- * Toolbars *
- ************/
- %toolbar {
- -GtkWidget-window-dragging: true;
- padding: 4px;
- background-color: $bg_color;
- }
- toolbar {
- @extend %toolbar;
- @include headerbar_fill;
- box-shadow: none;
- border-bottom:1px solid $borders_color;
- padding: 4px 3px 3px 4px;
- // on OSD
- .osd & { background-color: transparent; }
- // stand-alone OSD toolbars
- &.osd {
- padding: 13px;
- border: none;
- border-radius: 5px;
- background-color: $osd_bg_color;
- &.left,
- &.right,
- &.top,
- &.bottom { border-radius: 0; } // positional classes for `attached` osd toolbars
- }
- // toolbar separators
- &.horizontal separator { margin: 0 7px 1px 6px; }
- &.vertical separator { margin: 6px 1px 7px 0; }
- &:not(.inline-toolbar):not(.osd) {
- switch,
- scale,
- entry,
- spinbutton,
- button {
- margin-right: 1px;
- margin-bottom: 1px;
- }
- }
- }
- //searchbar, location-bar & inline-toolbar
- .inline-toolbar {
- @extend %toolbar;
- @extend %darkbar;
- padding: 3px;
- border-width: 0 1px 1px;
- border-radius: 0 0 5px 5px;
- }
- searchbar,
- .location-bar {
- @extend %toolbar;
- @extend %darkbar;
- border-width: 0 0 1px;
- padding: 3px;
- }
- %darkbar {
- border-style: solid;
- border-color: $borders_color;
- $_bg: mix($bg_color, $borders_color, 70%);
- background-color: $_bg;
- &:backdrop {
- border-color: $backdrop_borders_color;
- background-color: $backdrop_dark_fill;
- box-shadow: none;
- transition: $backdrop_transition;
- }
- }
- /***************
- * Header bars *
- ***************/
- %titlebar,
- headerbar {
- padding: 0 5px;
- min-height: 38px;
- border-width: 0 0 1px;
- border-style: solid;
- border-color: $borders_color;
- border-radius: 0;
- @include headerbar_fill;
- &:backdrop {
- border-color: $backdrop_borders_color;
- background-color: $bg_color;
- background-image: none;
- box-shadow: inset 0 1px $top_hilight;
- transition: $backdrop_transition;
- }
- .title {
- font-weight: bold;
- padding-left: 12px;
- padding-right: 12px;
- }
- .subtitle {
- font-size: smaller;
- padding-left: 12px;
- padding-right: 12px;
- @extend .dim-label;
- }
- &.selection-mode {
- $_hc: mix($top_hilight,$selected_bg_color, 50%); // hilight color
- color: $selected_fg_color;
- text-shadow: none;
- border-color: $selected_borders_color;
- @include headerbar_fill($selected_bg_color, $_hc);
- &:backdrop {
- background-color: $selected_bg_color;
- background-image: none;
- box-shadow: inset 0 1px mix($top_hilight, $selected_bg_color, 60%);
- }
- .subtitle:link { @extend *:link:selected; }
- button {
- @include button(normal, $selected_bg_color, $selected_fg_color);
- &.flat { @include button(undecorated); }
- &:hover { @include button(hover, $selected_bg_color, $selected_fg_color); }
- &:active,
- &:checked { @include button(active, $selected_bg_color, $selected_fg_color); }
- &:backdrop {
- &.flat, & {
- @include button(backdrop, $selected_bg_color, $selected_fg_color);
- -gtk-icon-effect: none;
- border-color: $selected_borders_color;
- &:active,
- &:checked {
- @include button(backdrop-active, $selected_bg_color, $selected_fg_color);
- border-color: $selected_borders_color;
- }
- &:disabled {
- @include button(backdrop-insensitive, $selected_bg_color, $selected_fg_color);
- border-color: $selected_borders_color;
- &:active, &:checked {
- @include button(backdrop-insensitive-active, $selected_bg_color, $selected_fg_color);
- border-color: $selected_borders_color;
- }
- }
- }
- }
- &.flat { &:backdrop, &:disabled, &:backdrop:disabled { @include button(undecorated); }}
- &:disabled {
- @include button(insensitive, $selected_bg_color, $selected_fg_color);
- &:active,
- &:checked { @include button(insensitive-active, $selected_bg_color, $selected_fg_color); }
- }
- &.suggested-action {
- @include button(normal);
- color: $selected_fg_color;
- border-color: $selected_borders_color;
- &:hover {
- @include button(hover);
- border-color: $selected_borders_color;
- }
- &:active {
- @include button(active);
- border-color: $selected_borders_color;
- }
- &:disabled {
- @include button(insensitive);
- background-image: none;
- background: $bg_color;
- border-color: $selected_borders_color;
- }
- &:backdrop {
- @include button(backdrop);
- border-color: $selected_borders_color;
- }
- &:backdrop:disabled {
- @include button(backdrop-insensitive);
- border-color: $selected_borders_color;
- }
- }
- }
- .selection-menu {
- &:backdrop, & {
- border-color: transparentize($selected_bg_color, 1);
- background-color: transparentize($selected_bg_color, 1);
- background-image: none;
- box-shadow: none;
- padding-left: 10px;
- padding-right: 10px;
- GtkArrow { -GtkArrow-arrow-scaling: 1; }
- .arrow {
- -gtk-icon-source: -gtk-icontheme('pan-down-symbolic');
- color: transparentize($selected_fg_color,0.5);
- -gtk-icon-shadow: none;
- }
- }
- }
- }
- .tiled &,
- .maximized & { &:backdrop, & { border-radius: 0; }} // squared corners when the window is maximized or tiled
- &.default-decoration {
- padding: 4px;
- min-height: 28px;
- button.titlebutton {
- min-height: 26px;
- min-width: 26px;
- margin: 0;
- padding: 0;
- }
- }
- .solid-csd & {
- &:backdrop, & {
- &:dir(rtl), &:dir(ltr) { // specificity bump
- margin-left: -1px;
- margin-right: -1px;
- margin-top: -1px;
- border-radius: 0;
- box-shadow: none;
- }
- }
- }
- }
- headerbar {
- // add vertical margins to common widget on the headerbar to avoid them spanning the whole height
- entry,
- spinbutton,
- separator,
- button {
- margin-top: 3px;
- margin-bottom: 3px;
- }
- button.titlebutton image {
- min-width: 22px;
- min-height: 22px;
- }
- button:not(.image-button):not(.titlebutton) image {
- min-width: 28px;
- min-height: 28px;
- }
- button.image-button {
- min-width: 28px;
- min-height: 28px;
- padding-left: 2px;
- padding-right: 2px;
- }
- switch {
- margin-top: 9px;
- margin-bottom: 9px;
- }
- }
- .background:not(.tiled):not(.maximized) .titlebar {
- &:backdrop, & {
- border-top-left-radius: 7px;
- border-top-right-radius: 7px;
- }
- }
- headerbar {
- window:not(.tiled):not(.maximized) separator:first-child + &, // tackles the paned container case
- window:not(.tiled):not(.maximized) &:first-child { &:backdrop, & { border-top-left-radius: 7px; }}
- window:not(.tiled):not(.maximized) &:last-child { &:backdrop, & { border-top-right-radius: 7px; }}
- }
- .titlebar:not(headerbar) {
- window.csd > & {
- // in csd we assume every titlebar is a headerbar so reset anything, this is needed for split toolbars cases
- padding: 0;
- background-color: transparent;
- background-image: none;
- border-style: none;
- border-color: transparent;
- box-shadow: none;
- }
- > separator { background-color: $borders_color; }
- @extend %titlebar;
- }
- // Fixes: https://github.com/shimmerproject/Greybird/issues/157
- // workaround for ugly Ubuntu-related CSD patches
- .background:not(.csd):not(.ssd):not(.solid-csd) headerbar {
- &, &:backdrop {
- &, &:not(:last-child) {
- border-radius: 0;
- border-top-color: transparent;
- box-shadow: none;
- }
- }
- }
- /************
- * Pathbars *
- ************/
- .path-bar button {
- &.text-button, &.image-button, & {
- padding-left: 4px;
- padding-right: 4px;
- }
- &.text-button.image-button label {
- padding-left: 0;
- padding-right: 0;
- }
- &.text-button.image-button, & {
- label:last-child { padding-right: 8px; }
- label:first-child { padding-left: 8px; }
- }
- image {
- padding-left: 4px;
- padding-right: 4px;
- }
- &.slider-button {
- padding-left: 0;
- padding-right: 0;
- }
- }
- /**************
- * Tree Views *
- **************/
- treeview.view {
- @at-root * {
- -GtkTreeView-horizontal-separator: 4;
- -GtkTreeView-grid-line-width: 1;
- -GtkTreeView-grid-line-pattern: '';
- -GtkTreeView-tree-line-width: 1;
- -GtkTreeView-tree-line-pattern: '';
- -GtkTreeView-expander-size: 16;
- }
- border-left-color: mix($fg_color, $base_color, 50%); // this is actually the tree lines color,
- border-top-color: $bg_color; // while this is the grid lines color, better then nothing
- rubberband { @extend rubberband; } // to avoid borders being overridden by the previously set props
- &:selected {
- &:focus, & {
- border-radius: 0;
- @extend %selected_items;
- }
- &:backdrop, & {
- border-left-color: mix($selected_fg_color, $selected_bg_color, 50%);
- border-top-color: transparentize($fg_color, 0.9); // doesn't work unfortunatelly
- }
- }
- &:disabled {
- color: $insensitive_fg_color;
- &:selected {
- color: mix($selected_fg_color, $selected_bg_color, 40%);
- &:backdrop { color: mix($backdrop_selected_fg_color, $selected_bg_color, 30%); }
- }
- &:backdrop { color: $backdrop_insensitive_color; }
- }
- &.separator {
- min-height: 2px;
- color: $bg_color;
- &:backdrop { color: transparentize($bg_color, 0.9); }
- }
- &:backdrop {
- border-left-color: mix($backdrop_fg_color, $backdrop_bg_color, 50%);
- border-top: $backdrop_bg_color;
- }
- &:drop(active) {
- border-style: solid none;
- border-width: 1px;
- border-color: $selected_borders_color;
- &.after { border-top-style: none; }
- &.before { border-bottom-style: none; }
- }
- &.expander {
- -gtk-icon-source: -gtk-icontheme('pan-end-symbolic');
- &:dir(rtl) { -gtk-icon-source: -gtk-icontheme('pan-end-symbolic-rtl'); }
- color: mix($fg_color, $base_color, 70%);
- &:hover { color: $fg_color; }
- &:selected {
- color: mix($selected_fg_color, $selected_bg_color, 70%);
- &:hover { color: $selected_fg_color; }
- &:backdrop { color: mix($backdrop_selected_fg_color, $selected_bg_color, 70%); }
- }
- &:checked { -gtk-icon-source: -gtk-icontheme('pan-down-symbolic'); }
- &:backdrop { color: mix($backdrop_fg_color, $backdrop_base_color, 70%); }
- }
- &.progressbar { // progress bar in treeviews
- @if $variant == light { color: $base_color; }
- border: 1px solid $selected_borders_color;
- border-radius: 4px;
- background-color: $selected_bg_color;
- background-image: linear-gradient(to bottom,
- $selected_bg_color,
- darken($selected_bg_color, 10%));
- box-shadow: inset 0 1px if($variant=='light', transparentize(white, 0.7),
- transparentize(white, 0.85)),
- 0 1px if($variant=='light', transparentize(black, 0.8),
- transparentize(black, 0.9));
- &:selected {
- &:focus, & {
- border-radius: 4px;
- @if $variant == 'light' {
- color: $selected_bg_color;
- box-shadow: none;
- }
- @else { box-shadow: inset 0 1px transparentize(white, 0.95); }
- background-image: linear-gradient(to bottom,
- $base_color,
- darken($base_color, 10%));
- &:backdrop {
- @if $variant == 'light' {
- color: $selected_bg_color;
- border-color: $selected_borders_color; // otherwise it gets inherited by .view(?!?)
- }
- @else { border-color: $backdrop_base_color; }
- background-color: $backdrop_base_color;
- }
- }
- }
- &:backdrop {
- @if $variant == 'light' { color: $backdrop_base_color; }
- @else { border-color: $backdrop_base_color; }
- background-image: none;
- box-shadow: none;
- }
- }
- &.trough { // progress bar trough in treeviews
- background-color: transparentize($fg_color,0.9);
- border-radius: 4px;
- &:selected {
- &:focus, & {
- background-color: if($variant == 'light',
- transparentize($selected_fg_color, 0.7),
- darken($selected_bg_color, 10%));
- border-radius: 4px;
- @if $variant == 'light' {
- border-width: 1px 0;
- border-style: solid;
- border-color: $selected_bg_color;
- }
- }
- }
- }
- header {
- button {
- $_column_header_color: mix($fg_color, $base_color, 50%);
- @extend %column_header_button;
- color: $_column_header_color;
- background-color: $base_color;
- font-weight: bold;
- text-shadow: none;
- box-shadow: none;
- &:hover {
- @extend %column_header_button;
- color: mix($_column_header_color, $fg_color, 50%);
- box-shadow: none;
- transition: none; //I shouldn't need this
- }
- &:active {
- @extend %column_header_button;
- color: $fg_color;
- transition: none; //I shouldn't need this
- }
- }
- button:last-child { &:backdrop, & { border-right-style: none; }}
- }
- button.dnd,
- header.button.dnd { // for treeview-like derive widgets
- &:active, &:selected, &:hover, & {
- padding: 0 6px;
- transition: none;
- background-image: none;
- background-color: $selected_bg_color;
- color: $base_color;
- border-radius: 0;
- border-style: none;
- box-shadow: inset 0 0 0 1px $base_color;
- text-shadow: none;
- }
- }
- acceleditor > label { background-color: $selected_bg_color; } // see tests/testaccel to test
- }
- %column_header_button {
- padding: 0 6px;
- border-radius: 0;
- background-image: none;
- text-shadow: none;
- border-style: none solid solid none;
- border-color: $bg_color;
- &:disabled {
- border-color: $bg_color;
- background-image: none;
- }
- &:backdrop {
- border-color: $backdrop_bg_color;
- border-style: none solid solid none;
- color: mix($backdrop_fg_color, $backdrop_bg_color, 50%);
- background-image: none;
- background-color: $backdrop_base_color;
- &:disabled {
- border-color: $backdrop_bg_color;
- background-image: none;
- }
- }
- }
- /*********
- * Menus *
- *********/
- menubar,
- .menubar {
- -GtkWidget-window-dragging: true;
- padding: 0px;
- &:backdrop { background-color: $backdrop_bg_color; }
- > menuitem {
- min-height: 16px;
- padding: 3px 8px;
- border: 1px solid transparent;
- &:hover { //Seems like it :hover even with keyboard focus
- background-image: linear-gradient(to bottom,
- shade($selected_bg_color, 1.2),
- shade($selected_bg_color, 1.0)
- );
- color: $selected_fg_color;
- border-color: shade($selected_bg_color, 1.1);
- }
- &:disabled {
- color: $insensitive_fg_color;
- box-shadow: none;
- }
- }
- }
- menu,
- .menu,
- .context-menu {
- margin: 4px;
- padding: 2px 0px;
- background-color: $menu_color;
- border: 1px solid $borders_color; // adds borders in a non composited env
- .csd & { border: none; } // axes borders in a composited env
- &:backdrop { background-color: $backdrop_menu_color; }
- menuitem {
- min-height: 16px;
- min-width: 40px;
- padding: 4px 6px;
- text-shadow: none;
- &:hover {
- color: $selected_fg_color;
- background-image: linear-gradient(to bottom, shade($selected_bg_color, 1.2), shade($selected_bg_color, 1.0));
- box-shadow: inset 1px 1px shade($selected_bg_color, 0.8),
- inset -1px -1px shade($selected_bg_color, 0.8);
- }
- &:disabled {
- color: $insensitive_fg_color;
- &:backdrop { color: $backdrop_insensitive_color; }
- }
- &:backdrop,
- &:backdrop:hover {
- color: $backdrop_fg_color;
- background-color: transparent;
- }
- // submenu indicators
- arrow {
- min-height: 16px;
- min-width: 16px;
- &:dir(ltr) {
- -gtk-icon-source: -gtk-icontheme('pan-end-symbolic');
- margin-left: 10px;
- }
- &:dir(rtl) {
- -gtk-icon-source:-gtk-icontheme('pan-end-symbolic-rtl');
- margin-right: 10px;
- }
- }
- // avoids labels color being overridden, see
- // https://bugzilla.gnome.org/show_bug.cgi?id=767058
- label { &:dir(rtl), &:dir(ltr) { color: inherit; }}
- }
- // overflow arrows
- > arrow {
- @include button(undecorated);
- min-height: 16px;
- min-width: 16px;
- padding: 4px;
- background-color: $menu_color;
- border-radius: 0;
- &.top {
- margin-top: -6px;
- border-bottom: 1px solid mix($fg_color, $base_color, 10%);
- -gtk-icon-source: -gtk-icontheme('pan-up-symbolic');
- }
- &.bottom {
- margin-bottom: -6px;
- border-top: 1px solid mix($fg_color, $base_color, 10%);
- -gtk-icon-source: -gtk-icontheme('pan-down-symbolic');
- }
- &:hover { background-color: mix($fg_color, $base_color, 10%); }
- &:backdrop { background-color: $backdrop_menu_color; }
- &:disabled {
- color: transparent;
- background-color: transparent;
- border-color: transparent ;
- }
- }
- }
- menuitem {
- accelerator { color: gtkalpha(currentColor,0.55); }
- check,
- radio {
- min-height: 16px;
- min-width: 16px;
- &:dir(ltr) { margin-right: 7px; }
- &:dir(rtl) { margin-left: 7px; }
- }
- }
- /***************
- * Popovers *
- ***************/
- popover.background {
- padding: 2px;
- border-radius: 5px;
- background-color: $popover_bg_color;
- modelbutton:hover { color: $selected_fg_color; }
- .csd &, & { border: 1px solid $borders_color; }
- box-shadow: 0 1px 2px transparentize(black, 0.7);
- &:backdrop {
- background-color: $backdrop_bg_color;
- box-shadow: none;
- }
- > list,
- > .view,
- > toolbar {
- border-style: none;
- background-color: transparent;
- }
- .csd &, & {
- &.touch-selection,
- &.magnifier {
- @extend %osd;
- border: 1px solid transparentize(white, 0.9);
- button { @extend %osd_button };
- }
- &.osd { @extend %osd; }
- }
- separator { margin: 3px; }
- list separator { margin: 0px; }
- checkbutton,
- radiobutton { @extend modelbutton.flat; }
- }
- /*************
- * Notebooks *
- *************/
- notebook {
- &.frame { border-style: none; }
- > header {
- padding: 1px;
- background-color: $bg_color;
- &:backdrop {
- border-color: $backdrop_borders_color;
- background-color: $backdrop_bg_color;
- }
- tabs { margin: -1px; }
- &.top {
- > stack { border-top-style: none; }
- > tabs > tab {
- border-radius: 3px 3px 0 0;
- border: 1px solid shade($bg_color, 0.9);
- &:backdrop { box-shadow: none; }
- &:checked { border-width: 1px 1px 0 1px; }
- }
- }
- &.bottom {
- > stack { border-bottom-style: none; }
- > tabs > tab {
- border-radius: 0 0 3px 3px;
- &:backdrop { box-shadow: none; }
- &:checked { border-width: 0 1px 1px 1px; }
- }
- }
- &.left {
- > stack { border-left-style: none; }
- > tabs > tab {
- border-radius: 3px 0 0 3px;
- &:backdrop { box-shadow: none; }
- &:checked { border-width: 1px 0 1px 1px; }
- }
- }
- &.right {
- > stack { border-right-style: none; }
- > tabs > tab {
- border-radius: 0 3px 3px 0;
- &:backdrop { box-shadow: none; }
- &:checked { border-width: 1px 1px 1px 0; }
- }
- }
- &.top > tabs > arrow {
- @extend %notebook_vert_arrows;
- border-top-style: none;
- }
- &.bottom > tabs > arrow {
- @extend %notebook_vert_arrows;
- border-bottom-style: none;
- }
- @at-root %notebook_vert_arrows {
- margin-left: -5px;
- margin-right: -5px;
- padding-left: 4px;
- padding-right: 4px;
- &.down { -gtk-icon-source: -gtk-icontheme('pan-start-symbolic'); }
- &.up { -gtk-icon-source: -gtk-icontheme('pan-end-symbolic'); }
- }
- &.left > tabs > arrow {
- @extend %notebook_horz_arrows;
- border-left-style: none;
- }
- &.right > tabs > arrow {
- @extend %notebook_horz_arrows;
- border-right-style: none;
- }
- @at-root %notebook_horz_arrows {
- margin-top: -5px;
- margin-bottom: -5px;
- padding-top: 4px;
- padding-bottom: 4px;
- &.down { -gtk-icon-source: -gtk-icontheme('pan-up-symbolic'); }
- &.up { -gtk-icon-source: -gtk-icontheme('pan-down-symbolic'); }
- }
- > tabs > arrow {
- @extend %button_basic;
- @extend %button_basic.flat;
- min-height: 16px;
- min-width: 16px;
- border-radius: 0;
- &:hover:not(:active):not(:backdrop) {
- background-clip: padding-box;
- background-image: none;
- background-color: transparentize(white, 0.7);
- border-color: transparent;
- box-shadow: none;
- }
- &:disabled { @include button(undecorated); }
- }
- tab {
- min-height: 20px;
- min-width: 24px;
- padding: 3px 12px;
- outline-offset: -5px;
- color: $insensitive_fg_color;
- background-color: $bg_color;
- border-width: 1px; // for reorderable tabs
- border-radius: 3px;
- border-color: shade($bg_color, 0.9); //
- border-style: solid;
- &:hover {
- color: mix($insensitive_fg_color, $fg_color, 50%);
- &.reorderable-page {
- border-color: transparentize($borders_color, 0.7);
- background-color: transparentize($bg_color, 0.8);
- }
- }
- &:backdrop {
- color: mix($backdrop_fg_color, $backdrop_bg_color, 60%);
- &.reorderable-page {
- border-color: transparent;
- background-color: transparent;
- }
- }
- &:checked {
- color: $fg_color;
- background-color: shade($bg_color, 1.05);
- border-width: 1px 1px 0 1px;
- &:backdrop {
- background-color: $bg_color;
- }
- &.reorderable-page {
- border-color: transparentize($borders_color, 0.5);
- background-color: shade($bg_color, 1.05);
- }
- }
- &:backdrop:checked {
- color: $backdrop_fg_color;
- &.reorderable-page {
- border-color: $backdrop_borders_color;
- background-color: $backdrop_bg_color;
- }
- }
- // colors the button like the label, overridden otherwise
- button.flat {
- &:hover { color: currentColor; }
- &, &:backdrop { color: gtkalpha(currentColor, 0.3); }
- padding: 0;
- margin-top: 1px;
- margin-bottom: 1px;
- // FIXME: generalize .small-button?
- min-width: 16px;
- min-height: 16px;
- &:last-child {
- margin-left: 1px;
- margin-right: -1px;
- }
- &:first-child {
- margin-left: -1px;
- margin-right: 1px;
- }
- }
- }
- &.top,
- &.bottom {
- tabs {
- padding: 0;
- &:not(:only-child) {
- margin-left: 2px;
- margin-right: 2px;
- }
- &:first-child { margin-left: -3px; }
- &:last-child { margin-right: -3px; }
- tab {
- margin-left: 2px;
- margin-right: 2px;
- }
- }
- }
- &.left,
- &.right {
- tabs {
- padding: 0;
- &:not(:only-child) {
- margin-top: 2px;
- margin-bottom: 2px;
- }
- &:first-child { margin-top: -3px; }
- &:last-child { margin-bottom: -3px; }
- tab {
- margin-top: 2px;
- margin-bottom: 2px;
- }
- }
- }
- &.top tab { padding-bottom: 4px; }
- &.bottom tab { padding-top: 4px; }
- }
- &.frame {
- > header {
- &.top > tabs {
- margin-bottom: -2px;
- }
- &.bottom > tabs {
- margin-top: -2px;
- }
- &.left > tabs {
- margin-right: -2px;
- }
- &.right > tabs {
- margin-left: -2px;
- }
- }
- > stack:not(:only-child) { // the :not(:only-child) is for "hidden" notebooks
- background-color: shade($bg_color, 1.05);
- border: 1px solid shade($bg_color, 0.9);
- &:backdrop { background-color: $backdrop_bg_color; }
- }
- }
- }
- /**************
- * Scrollbars *
- **************/
- scrollbar {
- $_slider_min_length: 40px;
- // disable steppers
- @at-root * {
- -GtkScrollbar-has-backward-stepper: false;
- -GtkScrollbar-has-forward-stepper: false;
- }
- background-image: linear-gradient(to right,
- lighten($bg_color, 10%),
- lighten($bg_color, 30%)
- );
- transition: 300ms $ease-out-quad;
- // scrollbar border
- &.top { border-bottom: 1px solid lighten($bg_color, 5%); }
- &.bottom { border-top: 1px solid lighten($bg_color, 5%); }
- &.left { border-right: 1px solid lighten($bg_color, 5%); }
- &.right { border-left: 1px solid lighten($bg_color, 5%); }
- &:backdrop {
- background-color: $backdrop_scrollbar_bg_color;
- border-color: lighten($bg_color, 5%);
- transition: $backdrop_transition;
- }
- // slider
- slider {
- min-width: 7px;
- min-height: 7px;
- margin: 3px;
- border: 1px solid darken($bg_color, 30%);
- border-radius: 10px;
- background-clip: padding-box;
- background-image: linear-gradient(to right,
- lighten($scrollbar_slider_color, 5%),
- lighten($scrollbar_slider_color, 1%));
- &:hover {
- background-image: linear-gradient(to right,
- darken($scrollbar_slider_color, 5%),
- darken($scrollbar_slider_color, 1%));
- }
- &:hover:active { background-color: $scrollbar_slider_active_color; }
- &:backdrop { background-color: $backdrop_scrollbar_slider_color; }
- &:disabled { background-color: transparent; }
- }
- &.fine-tune {
- slider {
- min-width: 4px;
- min-height: 4px;
- }
- &.horizontal slider { border-width: 5px 4px; }
- &.vertical slider { border-width: 4px 5px; }
- }
- &.overlay-indicator {
- &:not(.dragging):not(.hovering) {
- border-color: transparent;
- opacity: 0.4;
- background-color: transparent;
- slider {
- margin: 0;
- min-width: 6px;
- min-height: 6px;
- background-color: shade($fg_color, 0.9);
- background-image: none;
- border: 1px solid if($variant == 'light', white, black);
- }
- button {
- min-width: 5px;
- min-height: 5px;
- background-color: shade($fg_color, 0.9);
- background-image: none;
- background-clip: padding-box;
- border-radius: 100%;
- border: 1px solid if($variant == 'light', white, black);
- -gtk-icon-source: none;
- }
- &.horizontal {
- slider {
- margin: 0 2px;
- min-width: $_slider_min_length;
- }
- button {
- margin: 1px 2px;
- min-width: 5px;
- }
- }
- &.vertical {
- slider {
- margin: 2px 0;
- min-height: $_slider_min_length;
- }
- button {
- margin: 2px 1px;
- min-height: 5px;
- }
- }
- }
- &.dragging,
- &.hovering { opacity: 0.8; }
- }
- &.horizontal slider { min-width: $_slider_min_length; }
- &.vertical slider { min-height: $_slider_min_length; }
- // button styling
- button {
- padding: 0;
- min-width: 12px;
- min-height: 12px;
- border-style: none;
- border-radius: 0;
- transition-property: min-height, min-width, color;
- @include button(undecorated);
- color: $scrollbar_slider_color;
- &:hover {
- @include button(undecorated);
- color: $scrollbar_slider_hover_color;
- }
- &:active, &:checked {
- @include button(undecorated);
- color: $scrollbar_slider_active_color;
- }
- &:disabled {
- @include button(undecorated);
- color: transparentize($scrollbar_slider_color, 0.8);
- }
- &:backdrop {
- @include button(undecorated);
- color: $backdrop_scrollbar_slider_color;
- &:disabled {
- @include button(undecorated);
- color: transparentize($backdrop_scrollbar_slider_color, 0.8);
- }
- }
- }
- // button icons
- &.vertical {
- button {
- &.down { -gtk-icon-source: -gtk-icontheme('pan-down-symbolic'); }
- &.up { -gtk-icon-source: -gtk-icontheme('pan-up-symbolic'); }
- }
- }
- &.horizontal {
- button {
- &.down { -gtk-icon-source: -gtk-icontheme('pan-end-symbolic'); }
- &.up { -gtk-icon-source: -gtk-icontheme('pan-start-symbolic'); }
- }
- }
- }
- treeview ~ scrollbar.vertical {
- border-top: 1px solid $borders_color;
- margin-top: -1px;
- }
- /**********
- * Switch *
- **********/
- switch {
- font-size: 0;
- outline-offset: -4px;
- box-shadow: inset 0 1px transparentize(black, 0.9), // needs to be set here
- _widget_edge(transparent); // otherwise it gets
- // clipped
- // similar to the .scale
- border: 1px solid gtkalpha(black, 0.25);
- border-radius: 10px;
- background-color: mix($bg_color, $borders_color, 60%);
- text-shadow: 0 1px transparentize(black, 0.9);
- min-height: 20px;
- min-width: 20px;
- transition: all 200ms ease-in;
- &:checked {
- box-shadow: inset 0 1px transparentize(black, 0.9),
- _widget_edge(transparent);
- border-color: shade($selected_borders_color, 1.1);
- background-image: linear-gradient(to bottom,
- shade($selected_bg_color, 1.1),
- $selected_bg_color
- );
- text-shadow: 0 1px transparentize($selected_borders_color, 0.5),
- 0 0 2px transparentize(white, 0.4);
- }
- &:disabled {
- border-color: $borders_color;
- background-color: $insensitive_bg_color;
- box-shadow: _widget_edge(transparent);
- text-shadow: none;
- }
- &:backdrop {
- border-color: $backdrop_borders_color;
- background-color: $backdrop_dark_fill;
- box-shadow: none;
- text-shadow: none;
- transition: $backdrop_transition;
- &:checked {
- @if $variant == 'light' { color: $backdrop_bg_color; }
- border-color: transparentize($selected_borders_color, 0.3);
- background-color: transparentize($selected_bg_color, 0.3);
- background-image: none;
- box-shadow: none;
- }
- }
- &:disabled {
- border-color: $backdrop_borders_color;
- background-image: none;
- background-color: $insensitive_bg_color;
- }
- slider {
- margin: -1px;
- border: 1px solid gtkalpha(black, 0.2);
- border-radius: 10px;
- min-width: 20px;
- min-height: 20px;
- transition: $button_transition;
- @include button(normal-alt, $edge: $shadow_color);
- }
- &:hover slider { @include button(hover-alt, $edge: $shadow_color); }
- &:checked slider { border: 1px solid gtkalpha($selected_borders_color, 0.8); }
- &:disabled slider { @include button(insensitive); }
- &:backdrop {
- slider {
- transition: $backdrop_transition;
- @include button(backdrop);
- }
- &:checked slider { border-color: transparentize($selected_borders_color, 0.3); }
- &:disabled slider { @include button(backdrop-insensitive); }
- }
- row:selected & {
- @if $variant == 'light' {
- box-shadow: none;
- border-color: $selected_borders_color;
- &:backdrop { border-color: $selected_borders_color; }
- &.slider:dir(rtl) { border-left-color: $borders_color; }
- &.slider:dir(ltr) { border-right-color: $borders_color; }
- &.slider { &:checked, & { border-color: $selected_borders_color; } }
- }
- }
- }
- /*************************
- * Check and Radio items *
- *************************/
- // draw regular check and radio items using our PNG assets
- // all assets are rendered from assets.svg. never add pngs directly
- //selection-mode
- @each $s,$as in ('','-selectionmode'),
- (':hover', '-hover-selectionmode'),
- (':active', '-active-selectionmode'),
- (':backdrop', '-backdrop-selectionmode'),
- (':checked', '-checked-selectionmode'),
- (':checked:hover', '-checked-hover-selectionmode'),
- (':checked:active', '-checked-active-selectionmode'),
- (':backdrop:checked', '-checked-backdrop-selectionmode') {
- .view.content-view.check#{$s}:not(list) {
- -gtk-icon-shadow: none;
- -gtk-icon-source: -gtk-scaled(url("assets/checkbox#{$as}.png"),
- url("assets/checkbox#{$as}@2.png"));
- background-color: transparent;
- }
- }
- checkbutton.text-button, radiobutton.text-button {
- // this is for a nice focus on check and radios text
- padding: 2px 0;
- outline-offset: 0;
- label:not(:only-child) {
- &:first-child { margin-left: 4px; }
- &:last-child { margin-right: 4px; }
- }
- }
- check,
- radio {
- margin: 0 4px;
- &:only-child { margin: 0; }
- min-height: 14px;
- min-width: 14px;
- border: 1px solid;
- -gtk-icon-source: none;
- @include button(normal-alt, $c:lighten($bg_color, 5%), $edge: $shadow_color);
- &:hover { @include button(hover-alt, $edge: $shadow_color); }
- &:active { @include button(active); }
- &:disabled { @include button(insensitive); }
- &:backdrop {
- @include button(backdrop);
- transition: $backdrop_transition;
- &:disabled { @include button(backdrop-insensitive); }
- }
- @if $variant == 'light' {
- // the borders of the light variant versions of checks and radios are too similar in luminosity to the selected background
- // color, hence we need special casing.
- row:selected & { border-color: $selected_borders_color; }
- }
- .osd & {
- @include button(osd);
- &:hover { @include button(osd); }
- &:active { @include button(osd-active); }
- &:backdrop { @include button(osd-backdrop); }
- &:disabled { @include button(osd-insensitive); }
- }
- menu menuitem & {
- margin: 0; // this is a workaround for a menu check/radio size allocation issue
- &, &:hover, &:disabled { //FIXME use button reset mixin
- min-height: 14px;
- min-width: 14px;
- background-image: none;
- background-color: transparent;
- box-shadow: none;
- -gtk-icon-shadow: none;
- color: inherit;
- border-color: currentColor;
- animation: none;
- }
- }
- }
- %check,
- check {
- border-radius: 3px;
- &:checked { -gtk-icon-source: image(-gtk-recolor(url("assets/check-symbolic.svg")),
- -gtk-recolor(url("assets/check-symbolic.symbolic.png"))); }
- &:indeterminate { -gtk-icon-source: image(-gtk-recolor(url("assets/dash-symbolic.svg")),
- -gtk-recolor(url("assets/dash-symbolic.symbolic.png"))); }
- }
- %radio,
- radio {
- border-radius: 100%;
- &:checked { -gtk-icon-source: image(-gtk-recolor(url("assets/bullet-symbolic.svg")),
- -gtk-recolor(url("assets/bullet-symbolic.symbolic.png"))); }
- &:indeterminate { -gtk-icon-source: image(-gtk-recolor(url("assets/dash-symbolic.svg")),
- -gtk-recolor(url("assets/dash-symbolic.symbolic.png"))); }
- }
- // let's animate things
- @keyframes check_check {
- from { -gtk-icon-transform: translate(6px, -3px) rotate(-45deg) scaleY(0.2) rotate(45deg) scaleX(0); }
- to { -gtk-icon-transform: unset; }
- }
- @keyframes check_radio {
- from { -gtk-icon-transform: scale(0); }
- to { -gtk-icon-transform: unset; }
- }
- @keyframes check_indeterminate {
- from { -gtk-icon-transform: scale(0, 1); }
- to { -gtk-icon-transform: unset; }
- }
- check:not(:indeterminate):checked { animation: check_check 400ms; }
- radio:not(:indeterminate):checked { animation: check_radio 400ms; }
- check:indeterminate:checked, radio:indeterminate:checked { animation: check_indeterminate 400ms; }
- // no animations in menus
- menu menuitem {
- check:not(:indeterminate):checked,
- radio:not(:indeterminate):checked,
- check:indeterminate:checked:active,
- radio:indeterminate:checked { animation: none; }
- }
- treeview.view check,
- treeview.view radio {
- &:selected {
- &:focus, & {
- color: $fg_color;
- @if $variant == 'light' { border-color: $selected_borders_color; }
- }
- &:disabled {
- color: $insensitive_fg_color;
- &:backdrop { color: $backdrop_insensitive_color; }
- }
- }
- &:backdrop { &:selected, & { color: $backdrop_fg_color; }}
- }
- treeview.view radio:selected { &:focus, & { @extend %radio; }} // This is a workaround
- /************
- * GtkScale *
- ************/
- %scale_trough {
- border: 1px solid $borders_color;
- border-radius: 3px;
- background-color: $dark_fill;
- box-shadow: inset 1px 1px transparentize(black, 0.9);
- &:disabled {
- background-color: $insensitive_bg_color;
- box-shadow: none;
- }
- &:backdrop {
- background-color: $backdrop_dark_fill;
- border-color: $backdrop_borders_color;
- box-shadow: none;
- transition: $backdrop_transition;
- &:disabled { background-color: $insensitive_bg_color; }
- }
- // ...on selected list rows
- row:selected & {
- box-shadow: none;
- &, &:disabled { border-color: $selected_borders_color; }
- }
- // OSD
- .osd & {
- border-color: $osd_borders_color;
- background-color: transparentize($osd_borders_color, 0.2);
- box-shadow: none;
- outline-color: transparentize($osd_fg_color, 0.8);
- &:disabled { background-color: $osd_insensitive_bg_color; }
- }
- }
- %scale_highlight {
- border: 1px solid shade($selected_bg_color, 0.7);
- border-radius: 3px;
- background-image: linear-gradient(to bottom,
- shade($selected_bg_color, 1.1),
- shade($selected_bg_color, 0.9)
- );
- &:disabled {
- background-color: transparent;
- border-color: transparent;
- }
- &:backdrop {
- border-color: transparentize($selected_borders_color, 0.3);
- background-color: transparentize($selected_bg_color, 0.3);
- background-image: none;
- &:disabled {
- background-color: transparent;
- border-color: transparent;
- }
- }
- // ...on selected list rows
- row:selected & { &:disabled, & { border-color: $selected_borders_color; } }
- // OSD
- .osd & {
- border-color: $osd_borders_color;
- &:disabled { border-color: transparent; }
- }
- }
- scale {
- // sizing
- $_marks_length: 6px;
- $_marks_distance: 6px;
- min-height: 10px;
- min-width: 10px;
- padding: 12px;
- // those are inside the trough node, I need them to show their own border over the trough one, so negative margin
- fill,
- highlight { margin: -2px; }
- // the slider is inside the trough, so to have make it bigger there's a negative margin
- slider {
- min-height: 13px;
- min-width: 13px;
- margin: -7px;
- }
- // click-and-hold the slider to activate
- &.fine-tune {
- &.horizontal {
- padding-top: 9px;
- padding-bottom: 9px;
- min-height: 16px;
- }
- &.vertical {
- padding-left: 9px;
- padding-right: 9px;
- min-width: 16px;
- }
- // to make the trough grow in fine-tune mode
- slider { margin: -6px; }
- fill,
- highlight,
- trough {
- border-radius: 5px;
- -gtk-outline-radius: 7px;
- }
- }
- // the backing bit
- trough {
- @extend %scale_trough;
- padding: 1px;
- outline-offset: 2px;
- -gtk-outline-radius: 5px;
- }
- // the colored part of the backing bit
- highlight { @extend %scale_highlight; }
- // this is another differently styled part of the backing bit, the most relevant use case is for example
- // in media player to indicate how much video stream has been cached
- fill {
- @extend %scale_trough;
- &, &:backdrop {
- background-color: $borders_color;
- box-shadow: none;
- }
- &:disabled {
- &, &:backdrop {
- border-color: transparent;
- background-color: transparent;
- }
- }
- // OSD
- .osd & {
- background-color: mix($osd_fg_color, $osd_borders_color, 25%);
- &:disabled {
- &, &:backdrop {
- border-color: transparent;
- background-color: transparent;
- }
- }
- }
- }
- slider {
- @include button(normal);
- background-image: linear-gradient(to bottom,
- shade($bg_color, 1.45),
- shade($bg_color, 1.15)
- );
- border: 1px solid darken($borders_color, 3%);
- border-radius: 100%;
- transition: $button_transition;
- transition-property: background, border, box-shadow;
- &:hover { @include button(hover-alt, $edge: $shadow_color); }
- &:active { border-color: $selected_borders_color; }
- &:disabled { @include button (insensitive); }
- &:backdrop {
- transition: $backdrop_transition;
- @include button(backdrop);
- &:disabled { @include button(backdrop-insensitive); }
- }
- // ...on selected list rows
- row:selected & { &, &:disabled { border-color: $selected_borders_color; } }
- // OSD
- .osd & {
- @include button(osd);
- border-color: darken($osd_borders_color, 3%);
- background-color: opacify($osd_bg_color, 1); // solid background needed here
- &:hover { @include button(osd-hover); }
- &:active { @include button(osd-active); }
- &:disabled { @include button(osd-insensitive); }
- &:backdrop {
- @include button(osd-backdrop);
- &:disabled { @include button(osd-backdrop-insensitive); }
- }
- }
- }
- value { color: gtkalpha(currentColor, 0.6); }
- marks {
- color: gtkalpha(currentColor, 0.4);
- @each $marks_class, $marks_pos, $marks_margin in (top, top, bottom),
- (bottom, bottom, top),
- (top, left, right),
- (bottom, right, left) {
- &.#{$marks_class} {
- margin-#{$marks_margin}: $_marks_distance;
- margin-#{$marks_pos}: -($_marks_distance + $_marks_length);
- }
- }
- }
- &.fine-tune marks {
- @each $marks_class, $marks_pos, $marks_margin in (top, top, bottom),
- (bottom, bottom, top),
- (top, left, right),
- (bottom, right, left) {
- &.#{$marks_class} {
- margin-#{$marks_margin}: $_marks_distance;
- margin-#{$marks_pos}: -($_marks_distance + $_marks_length - 3px);
- }
- }
- }
- &.horizontal {
- indicator {
- min-height: $_marks_length;
- min-width: 1px;
- }
- &.fine-tune indicator { min-height: ($_marks_length - 3px); }
- }
- &.vertical {
- indicator {
- min-height: 1px;
- min-width: $_marks_length;
- }
- &.fine-tune indicator { min-width: ($_marks_length - 3px); }
- }
- &.color {
- min-height: 0;
- min-width: 0;
- trough {
- background-image: image($borders_color);
- background-repeat: no-repeat;
- }
- &.horizontal {
- padding: 0 0 15px 0;
- trough {
- padding-bottom: 4px;
- background-position: 0 -3px;
- border-top-left-radius: 0;
- border-top-right-radius: 0;
- }
- slider {
- &:dir(ltr), &:dir(rtl) { // specificity bumb
- &:hover, &:backdrop, &:disabled, &:backdrop:disabled, & {
- margin-bottom: -15px;
- margin-top: 6px;
- }
- }
- }
- }
- &.vertical {
- &:dir(ltr) {
- padding: 0 0 0 15px;
- trough {
- padding-left: 4px;
- background-position: 3px 0;
- border-bottom-right-radius: 0;
- border-top-right-radius: 0;
- }
- slider {
- &:hover, &:backdrop, &:disabled, &:backdrop:disabled, & {
- margin-left: -15px;
- margin-right: 6px;
- }
- }
- }
- &:dir(rtl) {
- padding: 0 15px 0 0;
- trough {
- padding-right: 4px;
- background-position: -3px 0;
- border-bottom-left-radius: 0;
- border-top-left-radius: 0;
- }
- slider {
- &:hover, &:backdrop, &:disabled, &:backdrop:disabled, & {
- margin-right: -15px;
- margin-left: 6px;
- }
- }
- }
- }
- &.fine-tune {
- &.horizontal {
- &:dir(ltr), &:dir(rtl) { // specificity bump
- padding: 0 0 12px 0;
- trough {
- padding-bottom: 7px;
- background-position: 0 -6px;
- }
- slider {
- margin-bottom: -15px;
- margin-top: 6px;
- }
- }
- }
- &.vertical {
- &:dir(ltr) {
- padding: 0 0 0 12px;
- trough {
- padding-left: 7px;
- background-position: 6px 0;
- }
- slider {
- margin-left: -15px;
- margin-right: 6px;
- }
- }
- &:dir(rtl) {
- padding: 0 12px 0 0;
- trough {
- padding-right: 7px;
- background-position: -6px 0;
- }
- slider {
- margin-right: -15px;
- margin-left: 6px;
- }
- }
- }
- }
- }
- }
- /*****************
- * Progress bars *
- *****************/
- progressbar {
- // sizing
- &.horizontal {
- trough { min-height: 6px; padding: 1px 0; }
- progress { min-height: 8px; }
- }
- &.vertical {
- trough { min-width: 6px; padding: 0 1px; }
- progress { min-width: 8px; }
- }
- &.horizontal progress,
- &.vertical progress { margin: 0; }
- // FIXME: insensitive state missing and some other state should be set probably
- font-size: smaller;
- color: transparentize($fg_color, 0.6);
- &:backdrop {
- box-shadow: none;
- transition: $backdrop_transition;
- }
- trough { @extend %scale_trough; }
- &:backdrop trough { @extend %scale_trough:backdrop; } // looks like states are not passed to the trough component here
- progress {
- @extend %scale_highlight;
- border: 1px solid shade($selected_bg_color, 0.7);
- border-radius: 3px;
- &.left {
- border-top-left-radius: 3px;
- border-bottom-left-radius: 3px;
- }
- &.right {
- border-top-right-radius: 3px;
- border-bottom-right-radius: 3px;
- }
- &.top {
- border-top-right-radius: 3px;
- border-top-left-radius: 3px;
- }
- &.bottom {
- border-bottom-right-radius: 3px;
- border-bottom-left-radius: 3px;
- }
- }
- &:backdrop progress { // states not passed here as well
- @extend %scale_highlight:backdrop;
- box-shadow: none;
- }
- &.osd { // progressbar.osd used for epiphany page loading progress
- min-width: 3px;
- min-height: 3px;
- background-color: transparent;
- trough {
- border-style: none;
- border-radius: 0;
- background-color: transparent;
- box-shadow: none;
- }
- progress {
- border-style: none;
- border-radius: 0;
- }
- }
- trough.empty progress { all: unset; } // makes the progress indicator disappear, when the fraction is 0
- }
- /*************
- * Level Bar *
- *************/
- levelbar {
- block {
- min-width: 32px;
- min-height: 1px;
- }
- &.vertical block {
- min-width: 1px;
- min-height: 32px;
- }
- &:backdrop { transition: $backdrop_transition; }
- trough {
- border: 1px solid;
- padding: 2px;
- border-radius: 3px;
- @include entry(normal);
- &:backdrop { @include entry(backdrop); }
- }
- &.horizontal.discrete block { margin: 0 1px; }
- &.vertical.discrete block { margin: 1px 0; }
- block {
- border: 1px solid;
- border-radius: 1px;
- box-shadow: 0 1px transparentize(black, 0.8);
- &:backdrop { box-shadow: none; }
- &.low {
- border-color: if($variant == 'light', darken($warning_color, 20%), $warning_color);
- background-color: $warning_color;
- &:backdrop { border-color: $warning_color; };
- }
- &.high,
- &:not(.empty) {
- border-color: if($variant == 'light', darken($selected_bg_color, 20%), $selected_bg_color);
- background-color: $selected_bg_color;
- &:backdrop { border-color: $selected_bg_color; }
- }
- &.full {
- border-color: if($variant == 'light', darken($success_color, 20%), $success_color);
- background-color: $success_color;
- &:backdrop { border-color: $success_color; };
- }
- &.empty {
- background-color: transparent;
- border-color: if($variant == 'light', transparentize($fg_color,0.8), transparentize($fg_color,0.9));
- box-shadow: none;
- &:backdrop { border-color: transparentize($backdrop_fg_color,0.85); }
- }
- }
- }
- /****************
- * Print dialog *
- *****************/
- printdialog {
- paper {
- color: $fg_color;
- border: 1px solid $borders_color;
- background: white;
- padding: 0;
- &:backdrop {
- color: $backdrop_fg_color;
- border-color: $backdrop_borders_color;
- }
- }
- .dialog-action-box { margin: 12px; }
- }
- /**********
- * Frames *
- **********/
- frame > border,
- .frame {
- box-shadow: none;
- margin: 0;
- padding: 0;
- border-radius: 0;
- border: 1px solid $borders_color;
- &.flat { border-style: none; }
- &:backdrop { border-color: $backdrop_borders_color; }
- }
- actionbar > revealer > box {
- padding: 6px;
- border-top: 1px solid $borders_color;
- &:backdrop { border-color: $backdrop_borders_color; }
- }
- scrolledwindow {
- viewport.frame { // avoid double borders when viewport inside scrolled window
- border-style: none;
- }
- // This is used when content is touch-dragged past boundaries.
- // draws a box on top of the content, the size changes programmatically.
- overshoot {
- &.top {
- @include overshoot(top);
- &:backdrop { @include overshoot(top, backdrop); }
- }
- &.bottom {
- @include overshoot(bottom);
- &:backdrop { @include overshoot(bottom, backdrop); }
- }
- &.left {
- @include overshoot(left);
- &:backdrop { @include overshoot(left, backdrop); }
- }
- &.right {
- @include overshoot(right);
- &:backdrop { @include overshoot(right, backdrop); }
- }
- }
- // Overflow indication, works similarly to the overshoot, the size if fixed tho.
- undershoot {
- &.top { @include undershoot(top); }
- &.bottom { @include undershoot(bottom); }
- &.left { @include undershoot(left); }
- &.right { @include undershoot(right); }
- }
- junction { // the small square between two scrollbars
- border-color: transparent;
- // the border image is used to add the missing dot between the borders, details, details, details...
- border-image: linear-gradient(to bottom, $borders_color 1px, transparent 1px) 0 0 0 1 / 0 1px stretch;
- background-color: $scrollbar_bg_color;
- &:dir(rtl) { border-image-slice: 0 1 0 0; }
- &:backdrop {
- border-image-source: linear-gradient(to bottom, $backdrop_borders_color 1px, transparent 1px);
- background-color: $backdrop_scrollbar_bg_color;
- transition: $backdrop_transition;
- }
- }
- }
- //vbox and hbox separators
- separator {
- background: transparentize(black, 0.9);
- min-width: 1px;
- min-height: 1px;
- }
- /*********
- * Lists *
- *********/
- list {
- color: $text_color;
- background-color: $base_color;
- border-color: $borders_color;
- &:backdrop {
- background-color: $backdrop_base_color;
- border-color: $backdrop_borders_color;
- }
- row { padding: 2px; }
- }
- row {
- transition: all 150ms $ease-out-quad;
- &:hover { transition: none; }
- &:backdrop { transition: $backdrop_transition; }
- &.activatable {
- &.has-open-popup, // this is for indicathing which row generated a popover see https://bugzilla.gnome.org/show_bug.cgi?id=754411
- &:hover { background-color: if(variant == light, transparentize($fg_color, 0.9), transparentize($fg_color, 0.95)); }
- &:active { box-shadow: inset 0 2px 2px -2px transparentize(black, 0.8); }
- &:backdrop:hover { background-color: transparent; }
- &:selected {
- &:active { box-shadow: inset 0 2px 3px -1px transparentize(black, 0.5); }
- &.has-open-popup,
- &:hover { background-color: mix($fg_color, $selected_bg_color, 10%); }
- &:backdrop { background-color: $selected_bg_color; }
- }
- }
- &:selected { @extend %selected_items; }
- }
- /*********************
- * App Notifications *
- *********************/
- .app-notification,
- .app-notification.frame {
- @extend %osd;
- padding: 10px;
- border-radius: 0 0 5px 5px;
- background-color: $osd_bg_color;
- background-image: linear-gradient(to bottom, transparentize(black, 0.8),
- transparent 2px);
- background-clip: padding-box;
- &:backdrop {
- background-image: none;
- transition: $backdrop_transition;
- }
- button {
- @extend %osd_button;
- background: transparentize(black, 0.9);
- &:hover { background: transparentize(black, 0.7); }
- }
- border { border: none; }
- }
- /*************
- * Expanders *
- *************/
- expander {
- arrow {
- min-width: 16px;
- min-height: 16px;
- -gtk-icon-source: -gtk-icontheme('pan-end-symbolic');
- &:dir(rtl) { -gtk-icon-source: -gtk-icontheme('pan-end-symbolic-rtl'); }
- &:hover { color: lighten($fg_color,30%); } //only lightens the arrow
- &:checked { -gtk-icon-source: -gtk-icontheme('pan-down-symbolic'); }
- }
- }
- /************
- * Calendar *
- ***********/
- calendar {
- color: $text_color;
- border: 1px solid $borders_color;
- padding: 2px;
- &:selected {
- @extend %selected_items;
- border-radius: 6px;
- }
- &.header {
- border: none;
- border-bottom: 1px solid transparentize(black, 0.9);
- border-radius: 0;
- &:backdrop { border-color: transparentize(black, 0.9); }
- }
- &.button {
- @extend %undecorated_button;
- color: transparentize($fg_color, 0.55);
- &:hover {
- @extend %undecorated_button;
- color: $fg_color;
- }
- &:backdrop {
- @extend %undecorated_button;
- color: transparentize($backdrop_fg_color,0.55);
- }
- &:disabled {
- @extend %undecorated_button;
- color: transparentize($insensitive_fg_color,0.55);
- }
- }
- // out-of-range days
- &:indeterminate,
- &:indeterminate:backdrop { color: gtkalpha(currentColor, 0.25); }
- // .day-name and .week-number
- &.highlight,
- &.highlight:backdrop {
- font-size: smaller;
- color: darken($selected_bg_color,0.75);
- }
- &:backdrop {
- color: $backdrop_text_color;
- border-color: $backdrop_borders_color;
- }
- }
- /***********
- * Dialogs *
- ***********/
- messagedialog { // Message Dialog styling
- .titlebar {
- min-height: 20px;
- background-image: none;
- background-color: $bg_color;
- border-style: none;
- border-top-left-radius: 7px;
- border-top-right-radius: 7px;
- }
- &.csd { // rounded bottom border styling for csd version
- &.background {
- // bigger radius for better antialiasing
- border-bottom-left-radius: 9px;
- border-bottom-right-radius: 9px;
- }
- buttonbox { padding: 0px; }
- .dialog-action-area button {
- padding: 10px 14px; // labels are not vertically centered on message dialog, this is a workaround
- border-radius: 0;
- border-left-style: solid;
- border-right-style: none;
- border-bottom-style: none;
- &:first-child{
- border-left-style: none;
- border-bottom-left-radius: 7px;
- -gtk-outline-bottom-left-radius: 5px;
- }
- &:last-child {
- border-bottom-right-radius: 7px;
- -gtk-outline-bottom-right-radius: 5px;
- }
- }
- }
- }
- filechooser {
- .dialog-action-box {
- border-top: 1px solid $borders_color;
- &:backdrop { border-top-color: $backdrop_borders_color; }
- }
- #pathbarbox {
- border-bottom: 1px solid $bg_color;
- stack { background-color: $bg_color; }
- }
- }
- filechooserbutton:drop(active) {
- box-shadow: none;
- border-color: transparent;
- }
- /***********
- * Sidebar *
- ***********/
- .sidebar {
- border-style: none;
- background-color: $sidebar_bg_color;
- -gtk-icon-style: regular;
- row,
- treeview {
- border-top: 1px solid transparent;
- border-bottom: 1px solid transparent;
- &:selected, &:selected:focus {
- background-image: linear-gradient(to bottom,
- shade($sidebar_bg_color, 0.87),
- shade($sidebar_bg_color, 0.95) 10%,
- shade($sidebar_bg_color, 0.99) 92%,
- shade($sidebar_bg_color, 0.92)
- );
- border-top: 1px solid shade($bg_color, 0.85);
- border-bottom: 1px solid shade($bg_color, 1.12);
- label {
- color: $fg_color;
- &:backdrop { color: $backdrop_fg_color; }
- }
- &:backdrop {
- background-image: none;
- background-color: $bg_color;
- color: $fg_color;
- border-top: 1px solid shade($bg_color, 0.9);
- border-bottom: 1px solid shade($bg_color, 0.9);
- }
- }
- .view:selected, .view:selected:focus { color: $fg_color; }
- &:backdrop { background-color: transparent; }
- }
- @at-root %sidebar_left,
- &:dir(ltr),
- &.left,
- &.left:dir(rtl) {
- border-right: 1px solid $borders_color;
- border-left-style: none;
- border-top-style: none;
- border-bottom-style: none;
- }
- @at-root %sidebar_right
- &:dir(rtl),
- &.right {
- border-left: 1px solid $borders_color;
- border-right-style: none;
- border-top-style: none;
- border-bottom-style: none;
- }
- &:backdrop {
- background-color: $backdrop_sidebar_bg_color;
- border-color: $backdrop_borders_color;
- transition: $backdrop_transition;
- }
- list, treeview {
- background-color: transparent;
- &:backdrop {
- background-color: transparent;
- }
- }
- paned & { &.left, &.right, &.left:dir(rtl), &:dir(rtl), &:dir(ltr), & { border-style: none; } }
- }
- stacksidebar {
- &.sidebar {
- &:dir(ltr),
- &.left,
- &.left:dir(rtl) { list { @extend %sidebar_left; }}
- &:dir(rtl),
- &.right { list { @extend %sidebar_right; }}
- }
- row {
- padding: 10px 4px;
- > label {
- padding-left: 6px;
- padding-right: 6px;
- }
- &.needs-attention > label {
- @extend %needs_attention;
- background-size: 6px 6px, 0 0;
- }
- }
- }
- /****************
- * File chooser *
- ****************/
- $_placesidebar_icons_opacity: 0.7;
- placessidebar {
- > viewport.frame { border-style: none; }
- row {
- // Needs overriding of the GtkListBoxRow padding
- min-height: 24px;
- padding: 0px;
- // Using margins/padding directly in the SidebarRow
- // will make the animation of the new bookmark row jump
- > revealer { padding: 0 14px; }
- &:selected { color: $fg_color; }
- &:disabled { color: $insensitive_fg_color; }
- &:backdrop {
- color: $backdrop_fg_color;
- background-color: $backdrop_bg_color;
- &:selected { color: $backdrop_fg_color; }
- &:disabled { color: $backdrop_insensitive_color; }
- }
- image.sidebar-icon {
- &:dir(ltr) { padding-right: 8px; }
- &:dir(rtl) { padding-left: 8px; }
- }
- label.sidebar-label {
- &:dir(ltr) { padding-right: 2px; }
- &:dir(rtl) { padding-left: 2px; }
- }
- @at-root button.sidebar-button {
- @extend %button_basic.flat;
- @extend %button_selected.flat;
- min-height: 26px;
- min-width: 26px;
- margin-top: 3px;
- margin-bottom: 3px;
- padding: 0;
- border-radius: 100%;
- -gtk-outline-radius: 100%;
- &:not(:hover):not(:active),
- &:backdrop { > image { opacity: $_placesidebar_icons_opacity; }}
- }
- // in the sidebar case it makes no sense to click the selected row
- &:selected:active { box-shadow: none; }
- &.sidebar-placeholder-row {
- padding: 0 8px;
- min-height: 2px;
- background-image: image($drop_target_color);
- background-clip: content-box;
- }
- &.sidebar-new-bookmark-row { color: $selected_bg_color; }
- &:drop(active):not(:disabled) {
- color: $drop_target_color;
- box-shadow: inset 0 1px $drop_target_color,
- inset 0 -1px $drop_target_color;
- &:selected {
- color: $selected_fg_color;
- background-image: linear-gradient(to bottom,
- darken(mix(darken($base_color, 10%), lighten($selected_bg_color, 35%), 0.1), 13%),
- darken(mix(darken($base_color, 10%), lighten($selected_bg_color, 35%), 0.1), 5%) 10%,
- darken(mix(darken($base_color, 10%), lighten($selected_bg_color, 35%), 0.1), 1%) 92%,
- darken(mix(darken($base_color, 10%), lighten($selected_bg_color, 35%), 0.1), 8%)
- );
- }
- }
- }
- }
- placesview {
- .server-list-button > image {
- transition: 200ms $ease-out-quad;
- -gtk-icon-transform: rotate(0turn);
- }
- .server-list-button:checked > image {
- transition: 200ms $ease-out-quad;
- -gtk-icon-transform: rotate(-0.5turn);
- }
- row.activatable:hover { background-color: transparent; }
- // this selects the "connect to server" label
- > actionbar > revealer > box > label {
- padding-left: 8px;
- padding-right: 8px;
- }
- }
- /*********
- * Paned *
- *********/
- paned {
- > separator {
- min-width: 1px;
- min-height: 1px;
- -gtk-icon-source: none; // defeats the ugly default handle decoration
- border-style: none; // just to be sure
- background-color: transparent;
- // workaround, using background istead of a border since the border will get rendered twice (?)
- background-image: image($borders_color);
- background-size: 1px 1px;
- &:selected { background-image: image($selected_bg_color); } // FIXME is this needed?
- &:backdrop { background-image: image($backdrop_borders_color); }
- &.wide {
- min-width: 5px;
- min-height: 5px;
- background-color: $bg_color;
- background-image: image($borders_color), image($borders_color);
- background-size: 1px 1px, 1px 1px;
- &:backdrop {
- background-color: $backdrop_bg_color;
- background-image: image($backdrop_borders_color),
- image($backdrop_borders_color);
- }
- }
- }
- &.horizontal > separator {
- background-repeat: repeat-y;
- &:dir(ltr) {
- margin: 0 -8px 0 0;
- padding: 0 8px 0 0;
- background-position: left;
- }
- &:dir(rtl) {
- margin: 0 0 0 -8px;
- padding: 0 0 0 8px;
- background-position: right;
- }
- &.wide {
- margin: 0;
- padding: 0;
- background-repeat: repeat-y, repeat-y;
- background-position: left, right;
- }
- }
- &.vertical > separator {
- margin: 0 0 -8px 0;
- padding: 0 0 8px 0;
- background-repeat: repeat-x;
- background-position: top;
- &.wide {
- margin: 0;
- padding: 0;
- background-repeat: repeat-x, repeat-x;
- background-position: bottom, top;
- }
- }
- }
- /**************
- * GtkInfoBar *
- **************/
- infobar { border-style: none; }
- .info,
- .question,
- .warning,
- .error {
- &:backdrop, & {
- label, & { color: $selected_fg_color; }
- background-color: $selected_bg_color;
- border-color: darken($selected_bg_color, 10%);
- }
- text-shadow: 0 1px darken($selected_bg_color, 10%);
- &:backdrop { text-shadow: none; }
- button {
- // FIXME: extend selection mode buttons
- @include button(normal, $selected_bg_color, $selected_fg_color, none);
- border-color: darken($selected_bg_color, 20%);
- &:hover { @include button(hover, $selected_bg_color, $selected_fg_color, none); }
- &:active,
- &:checked { @include button(active, $selected_bg_color, $selected_fg_color, none); }
- &:disabled { @include button(insensitive,$selected_bg_color,$selected_fg_color,none); }
- &:backdrop {
- @include button(backdrop, $selected_bg_color, $selected_fg_color, none);
- border-color: _border_color($selected_bg_color);
- &:disabled {
- @include button(backdrop-insensitive, $selected_bg_color,
- $selected_fg_color, none);
- border-color: _border_color($selected_bg_color);
- }
- }
- }
- label:selected { &:focus, &:hover, & { background-color: darken($selected_bg_color, 10%); }}
- *:link { @extend %link_selected; }
- }
- /*************
- * Buttonbox *
- *************/
- buttonbox {
- padding: 6px;
- }
- /************
- * Tooltips *
- ************/
- tooltip {
- &.background {
- // background-color needs to be set this way otherwise it gets drawn twice
- // see https://bugzilla.gnome.org/show_bug.cgi?id=736155 for details.
- background-color: transparentize(black, 0.2);
- background-clip: padding-box;
- border: 1px solid $tooltip_borders_color; // this suble border is meant to
- // not make the tooltip melt with
- // very dark backgrounds
- }
- padding: 1px; /* not working */
- border-radius: 5px;
- box-shadow: none; // otherwise it gets inherited by windowframe.csd
- text-shadow: 0 1px black;
- // FIXME: we need a border or tooltips vanish on black background.
- decoration { background-color: transparent; }
- * { // Yeah this is ugly
- padding: 1px;
- background-color: transparent;
- color: white;
- }
- }
- /*****************
- * Color Chooser *
- *****************/
- colorswatch {
- // This widget is made of two boxes one on top of the other, the lower box is colorswatch {} the other one
- // is colorswatch overlay {}, colorswatch has the programmatically set background, so most of the style is
- // applied to the overlay box.
- &, &:drop(active) { border-style: none; } // FIXME: implement a proper drop(active) state
- $_colorswatch_radius: 5px;
- $_colorswatch_overlay_shadow: if($variant == 'light', inset 0 2px 2px -3px transparentize(black, 0.3),
- inset 0 3px 2px -2px transparentize(black, 0.5));
- // base color corners rounding
- // to avoid the artifacts caused by rounded corner anti-aliasing the base color
- // sports a bigger radius.
- // nth-child is needed by the custom color strip.
- &.top {
- border-top-left-radius: $_colorswatch_radius + 0.5px;
- border-top-right-radius: $_colorswatch_radius + 0.5px;
- overlay {
- border-top-left-radius: $_colorswatch_radius;
- border-top-right-radius: $_colorswatch_radius;
- }
- }
- &.bottom {
- border-bottom-left-radius: $_colorswatch_radius + 0.5px;
- border-bottom-right-radius: $_colorswatch_radius + 0.5px;
- overlay {
- border-bottom-left-radius: $_colorswatch_radius;
- border-bottom-right-radius: $_colorswatch_radius;
- }
- }
- &.left,
- &:first-child:not(.top) {
- border-top-left-radius: $_colorswatch_radius + 0.5px;
- border-bottom-left-radius: $_colorswatch_radius + 0.5px;
- overlay {
- border-top-left-radius: $_colorswatch_radius;
- border-bottom-left-radius: $_colorswatch_radius;
- }
- }
- &.right,
- &:last-child:not(.bottom) {
- border-top-right-radius: $_colorswatch_radius + 0.5px;
- border-bottom-right-radius: $_colorswatch_radius + 0.5px;
- overlay {
- border-top-right-radius: $_colorswatch_radius;
- border-bottom-right-radius: $_colorswatch_radius;
- }
- }
- &.dark overlay {
- color: $selected_fg_color;
- &:hover { border-color: if($variant == 'light', transparentize(black, 0.2), $borders_color); }
- &:backdrop { color: $backdrop_selected_fg_color; }
- }
- &.light overlay {
- color: $text_color;
- &:hover { border-color: if($variant == 'light', transparentize(black, 0.5), $borders_color); }
- &:backdrop { color: $backdrop_text_color; }
- }
- &:drop(active) {
- box-shadow: none;
- &.light overlay {
- border-color: $drop_target_color;
- box-shadow: inset 0 0 0 2px if($variant == 'light', darken($drop_target_color, 7%), $borders_color),
- inset 0 0 0 1px $drop_target_color;
- }
- &.dark overlay {
- border-color: $drop_target_color;
- box-shadow: inset 0 0 0 2px if($variant == 'light', transparentize(black, 0.7), $borders_color),
- inset 0 0 0 1px $drop_target_color;
- }
- }
- overlay {
- box-shadow: $_colorswatch_overlay_shadow;
- border: 1px solid if($variant == 'light', transparentize(black, 0.7), $borders_color);
- &:hover { box-shadow: inset 0 1px transparentize(white, 0.7); }
- &:backdrop, &:backdrop:hover {
- border-color: if($variant == 'light', transparentize(black, 0.7), $borders_color);
- box-shadow: none;
- }
- }
- &#add-color-button {
- border-radius: $_colorswatch_radius $_colorswatch_radius 0 0;
- &:only-child { border-radius: $_colorswatch_radius; }
- overlay {
- @include button(normal);
- &:hover { @include button(hover); }
- &:backdrop { @include button(backdrop); }
- }
- }
- &:disabled {
- opacity: 0.5;
- overlay {
- border-color: transparentize(black, 0.4);
- box-shadow: none;
- }
- }
- row:selected & { box-shadow: 0 0 0 2px $selected_fg_color; }
- &#editor-color-sample {
- border-radius: 4px;
- overlay { border-radius: 4.5px; }
- }
- }
- // colorscale popup
- colorchooser .popover.osd { border-radius: 5px; }
- /********
- * Misc *
- ********/
- //content view (grid/list)
- .content-view {
- background-color: darken($bg_color,7%);
- &:hover { -gtk-icon-effect: highlight; }
- &:backdrop { background-color: darken($bg_color,7%); }
- rubberband { @extend rubberband; }
- }
- .scale-popup {
- .osd & { @extend %osd; }
- .osd & button.flat { //FIXME: quick hack, redo properly
- border-style: none;
- border-radius: 5px;
- }
- button { // +/- buttons on GtkVolumeButton popup
- &:hover {
- @extend %undecorated_button;
- background-color: transparentize($fg_color,0.9);
- border-radius: 5px;
- }
- &:backdrop { &:hover, &:disabled, & { @extend %undecorated_button; }}
- }
- }
- /**********************
- * Window Decorations *
- *********************/
- decoration {
- border-radius: 7px 7px 0 0;
- // lamefun trick to get rounded borders regardless of CSD use
- border-width: 0px;
- // this needs to be transparent
- // see bug #722563
- $_wm_border: if($variant=='light', transparentize(black, 0.77), transparentize($borders_color, 0.1));
- $_wm_border_backdrop: if($variant=='light', transparentize(black, 0.82), transparentize($borders_color, 0.1));
- box-shadow: 0 3px 9px 1px transparentize(black, 0.5),
- 0 0 0 1px $_wm_border; //doing borders with box-shadow
- // FIXME rationalize shadows
- // this is used for the resize cursor area
- margin: 10px;
- &:backdrop {
- // the transparent shadow here is to enforce that the shadow extents don't
- // change when we go to backdrop, to prevent jumping windows.
- // The biggest shadow should be in the same order then in the active state
- // or the jumping will happen during the transition.
- box-shadow: 0 3px 9px 1px transparent,
- 0 2px 6px 2px transparentize(black, 0.8),
- 0 0 0 1px $_wm_border_backdrop;
- transition: $backdrop_transition;
- }
- .maximized &,
- .fullscreen &,
- .tiled & { border-radius: 0; }
- .popup & { box-shadow: none; }
- // server-side decorations as used by mutter
- .ssd & { box-shadow: 0 0 0 1px $_wm_border; } //just doing borders, wm draws actual shadows
- .csd.popup & {
- border-radius: 0;
- box-shadow: 0 1px 2px transparentize(black, 0.8),
- 0 0 0 1px transparentize($_wm_border,0.1);
- }
- tooltip.csd & {
- border-radius: 5px;
- box-shadow: none;
- }
- messagedialog.csd & {
- border-radius: 7px;
- box-shadow: 0 1px 2px transparentize(black, 0.8),
- 0 0 0 1px transparentize($_wm_border,0.1);
- }
- .solid-csd & {
- border-radius: 0;
- margin: 4px;
- background-color: $backdrop_bg_color;
- border: solid 1px $backdrop_borders_color;
- box-shadow: none;
- }
- }
- // Window buttons
- button.titlebutton {
- @extend %button_basic;
- @extend %button_basic.flat;
- @include _button_text_shadow;
- &.close, &.maximize, &.minimize {
- color: transparent;
- background-color: transparent;
- background-position: center;
- background-repeat: no-repeat;
- // fade the png buttons out on unfocused windows
- &:backdrop { opacity: 0.5; }
- }
- // Load png assets for each button
- @each $k in ('close','maximize', 'minimize') {
- @each $l, $m in ('',''), (':backdrop','-backdrop'), (':hover','-hover'), (':active','-active') {
- &.#{$k}#{$l} { background-image: -gtk-scaled(url('assets/titlebutton-#{$k}#{$m}#{$asset_suffix}.png'),
- url('assets/titlebutton-#{$k}#{$m}#{$asset_suffix}@2.png')); }
- }
- }
- .selection-mode & {
- @extend %button.flat.suggested-action;
- @extend %nobg_selected_items;
- }
- &:backdrop { -gtk-icon-shadow: none; }
- }
- headerbar.selection-mode button.titlebutton,
- .titlebar.selection-mode button.titlebutton {
- @include _button_text_shadow(white, $selected_bg_color);
- &:backdrop { -gtk-icon-shadow: none; }
- }
- // catch all extend :)
- %selected_items {
- background-color: $selected_bg_color;
- @at-root %nobg_selected_items, & {
- color: $selected_fg_color;
- @if $variant == 'light' { outline-color: transparentize($selected_fg_color, 0.7); }
- &:disabled { color: mix($selected_fg_color, $selected_bg_color, 50%); }
- &:backdrop {
- color: $backdrop_selected_fg_color;
- &:disabled { color: mix($backdrop_selected_fg_color, $selected_bg_color, 30%); }
- }
- }
- }
- .monospace { font-family: monospace; }
- /**********************
- * Touch Copy & Paste *
- *********************/
- //touch selection handlebars for the Popover.osd above
- cursor-handle {
- background-color: transparent;
- background-image: none;
- box-shadow: none;
- border-style: none;
- @each $s,$as in ('',''),
- (':hover','-hover'),
- (':active','-active') { //no need for insensitive and backdrop
- &.top#{$s}:dir(ltr), &.bottom#{$s}:dir(rtl) {
- $_url: 'assets/text-select-start#{$as}#{$asset_suffix}';
- -gtk-icon-source: -gtk-scaled(url('#{$_url}.png'),
- url('#{$_url}@2.png'));
- padding-left: 10px;
- }
- &.bottom#{$s}:dir(ltr), &.top#{$s}:dir(rtl) {
- $_url: 'assets/text-select-end#{$as}#{$asset_suffix}';
- -gtk-icon-source: -gtk-scaled(url('#{$_url}.png'),
- url('#{$_url}@2.png'));
- padding-right: 10px;
- }
- &.insertion-cursor#{$s}:dir(ltr), &.insertion-cursor#{$s}:dir(rtl) {
- $_url: 'assets/slider-horz-scale-has-marks-above#{$as}#{$asset_suffix}';
- -gtk-icon-source: -gtk-scaled(url('#{$_url}.png'),
- url('#{$_url}@2.png'));
- }
- }
- }
- .context-menu { font: initial; } // Decouple the font of context menus from their entry/textview
- button.circular { // FIXME: aggregate to buttons
- border-radius: 9999px;
- -gtk-outline-radius: 9999px;
- label { padding: 0; }
- }
- // shortcut window keys
- .keycap {
- min-width: 20px;
- min-height: 25px;
- margin-top: 2px;
- padding-bottom: 3px;
- padding-left: 6px;
- padding-right: 6px;
- color: $fg_color;
- background-color: $base_color;
- border: 1px solid;
- border-color: if($variant == 'light', mix($borders_color, $bg_color, 50%), $borders_color);
- border-radius: 5px;
- box-shadow: if($variant == 'light', inset 0 -3px mix($base_color, $bg_color, 20%), inset 0 -3px mix($borders_color, $base_color, 60%));
- font-size: smaller;
- &:backdrop {
- background-color: $backdrop_base_color;
- color: $backdrop_fg_color;
- transition: $backdrop_transition;
- }
- }
- :not(decoration):not(window):drop(active):focus,
- :not(decoration):not(window):drop(active) { // FIXME needs to be done widget by widget, this wildcard should really die
- border-color: $drop_target_color;
- box-shadow: inset 0 0 0 1px $drop_target_color;
- }
- stackswitcher button.text-button { min-width: 100px; } // FIXME aggregate with buttons
- stackswitcher button.circular,
- stackswitcher button.text-button.circular { // FIXME aggregate with buttons
- min-width: 32px;
- min-height: 32px;
- padding: 0;
- }
|