Wrap modules in exports mixin so they are included only once

pull/224/head
Satyajit Sahoo 2014-12-09 01:05:19 +05:30
parent f34745f3da
commit 0163f1997a
16 changed files with 988 additions and 1015 deletions

View File

@ -145,7 +145,8 @@
.linked & { @include linked_button($bg, $dark_shadow); } .linked & { @include linked_button($bg, $dark_shadow); }
} }
%close_button { @include exports("button") {
%close_button {
border: 1px solid transparent; border: 1px solid transparent;
background-color: transparent; background-color: transparent;
background-image: none; background-image: none;
@ -164,10 +165,11 @@
background-image: none; background-image: none;
box-shadow: none; box-shadow: none;
} }
} }
.button { .button {
@include button($bg_color, $fg_color); @include button($bg_color, $fg_color);
&.default { @include button($selected_bg_color, $selected_fg_color); } &.default { @include button($selected_bg_color, $selected_fg_color); }
}
} }

View File

@ -6,7 +6,8 @@
! Calendar ! Calendar
***********/ ***********/
GtkCalendar { @include exports("calendar") {
GtkCalendar {
padding: $spacing; padding: $spacing;
outline-offset: -1px; outline-offset: -1px;
@ -21,4 +22,6 @@ GtkCalendar {
} }
&.highlight { color: $selected_bg_color; } &.highlight { color: $selected_bg_color; }
}
} }

View File

@ -72,14 +72,17 @@
&.image.left { padding-right: $spacing; } &.image.left { padding-right: $spacing; }
} }
.entry { @include entry($base_color, $text_color); } @include exports("entry") {
.entry { @include entry($base_color, $text_color); }
}
/****************** /******************
! Combobox entry * ! Combobox entry *
*******************/ *******************/
GtkComboBox.combobox-entry { @include exports("comboboxentry") {
GtkComboBox.combobox-entry {
.entry { .entry {
&, &:hover, &:focus, &:active, &:insensitive { &, &:hover, &:focus, &:active, &:insensitive {
border-width: 1px 0 1px 1px; border-width: 1px 0 1px 1px;
@ -95,4 +98,6 @@ GtkComboBox.combobox-entry {
border-top-left-radius: 0; border-top-left-radius: 0;
} }
} }
}
} }

View File

@ -13,7 +13,7 @@
&-row { &-row {
border: none; border: none;
border-radius: 0; border-radius: 0;
padding: 3px; padding: $spacing;
background-image: none; background-image: none;
background-color: transparent; background-color: transparent;

View File

@ -7,7 +7,8 @@
! Infobar ! Infobar
**********/ **********/
GtkInfoBar { @include exports("infobar") {
GtkInfoBar {
border: none; border: none;
$types: ( $types: (
@ -35,4 +36,5 @@ GtkInfoBar {
} }
} }
} }
}
} }

View File

@ -7,7 +7,8 @@
! Menubar ! Menubar
**********/ **********/
.menubar { @include exports("menubar") {
.menubar {
-GtkWidget-window-dragging: true; -GtkWidget-window-dragging: true;
border: none; border: none;
@ -32,6 +33,7 @@
& *:hover { color: shade($menubar_fg_color, 1.08); } & *:hover { color: shade($menubar_fg_color, 1.08); }
} }
}
} }
@ -39,14 +41,15 @@
! Menu ! Menu
*******/ *******/
GtkTreeMenu, GtkMenuToolButton, GtkComboBox { @include exports("menu") {
GtkTreeMenu, GtkMenuToolButton, GtkComboBox {
&.menu, .menu { &.menu, .menu {
background-color: $menu_bg_color; background-color: $menu_bg_color;
margin: $spacing; margin: $spacing;
} }
} }
#toolbar-popup, .menu { #toolbar-popup, .menu {
padding: 0; padding: 0;
border-radius: 0; border-radius: 0;
border-style: none; border-style: none;
@ -62,11 +65,11 @@ GtkTreeMenu, GtkMenuToolButton, GtkComboBox {
background-image: none; background-image: none;
} }
} }
} }
.context-menu { font: initial; } .context-menu { font: initial; }
.menuitem { .menuitem {
GtkTreeMenu & { GtkTreeMenu & {
padding: 0; padding: 0;
border-width: 0; border-width: 0;
@ -147,16 +150,18 @@ GtkTreeMenu, GtkMenuToolButton, GtkComboBox {
} }
.entry { @include entry($menu_bg_color, $menu_fg_color); } .entry { @include entry($menu_bg_color, $menu_fg_color); }
} }
GtkModelMenuItem GtkBox GtkImage { padding-right: $spacing; } GtkModelMenuItem GtkBox GtkImage { padding-right: $spacing; }
}
/********* /*********
! Popover ! Popover
**********/ **********/
GtkPopover { @include exports("popover") {
GtkPopover {
@include border($menu_bg_color); @include border($menu_bg_color);
margin: 10px; margin: 10px;
@ -198,9 +203,9 @@ GtkPopover {
font-size: 80%; font-size: 80%;
font-weight: bold; font-weight: bold;
} }
} }
GtkModelButton.button { GtkModelButton.button {
&, &:focus, &:active, &:insensitive, &:active:insensitive { &, &:focus, &:active, &:insensitive, &:active:insensitive {
&, &:backdrop { &, &:backdrop {
background-color: transparent; background-color: transparent;
@ -220,4 +225,5 @@ GtkModelButton.button {
border: none; border: none;
border-radius: 2px; border-radius: 2px;
} }
}
} }

View File

@ -1,11 +1,13 @@
@import "functions"; @import "functions";
@import "global"; @import "global";
/********** /**********
! Notebook ! Notebook
***********/ ***********/
.notebook { @include exports("notebook") {
.notebook {
padding: 0; padding: 0;
border-width: 1px 0 0 0; border-width: 1px 0 0 0;
border-style: solid; border-style: solid;
@ -131,4 +133,5 @@
inset 1px 0 shade($base_color, 0.75), inset -1px 0 shade($base_color, 0.75); inset 1px 0 shade($base_color, 0.75), inset -1px 0 shade($base_color, 0.75);
} }
} }
}
} }

View File

@ -6,7 +6,8 @@
! Progress bars * ! Progress bars *
******************/ ******************/
GtkProgressBar { @include exports("progressbar") {
GtkProgressBar {
padding: 0; padding: 0;
border-radius: $roundness; border-radius: $roundness;
font-size: smaller; font-size: smaller;
@ -26,9 +27,9 @@ GtkProgressBar {
background-color: shade($bg_color, 1.08); background-color: shade($bg_color, 1.08);
background-image: none; background-image: none;
} }
} }
.progressbar { .progressbar {
background-image: none; background-image: none;
background-color: $selected_bg_color; background-color: $selected_bg_color;
border-radius: 0; border-radius: 0;
@ -60,9 +61,9 @@ GtkProgressBar {
border-top-right-radius: $roundness; border-top-right-radius: $roundness;
} }
} }
} }
GtkLevelBar { GtkLevelBar {
-GtkLevelBar-min-block-width: 34; -GtkLevelBar-min-block-width: 34;
-GtkLevelBar-min-block-height: 3; -GtkLevelBar-min-block-height: 3;
@ -70,9 +71,9 @@ GtkLevelBar {
-GtkLevelBar-min-block-width: 3; -GtkLevelBar-min-block-width: 3;
-GtkLevelBar-min-block-height: 34; -GtkLevelBar-min-block-height: 34;
} }
} }
.level-bar { .level-bar {
&.trough { &.trough {
border: 1px solid alpha(border_normal($bg_color), 0.5); border: 1px solid alpha(border_normal($bg_color), 0.5);
background-color: shade($bg_color, 1.08); background-color: shade($bg_color, 1.08);
@ -108,9 +109,9 @@ GtkLevelBar {
box-shadow: none; box-shadow: none;
} }
} }
} }
.scale { .scale {
-GtkRange-slider-width: 16; -GtkRange-slider-width: 16;
-GtkRange-trough-border: 1; -GtkRange-trough-border: 1;
-GtkScale-slider-length: 16; -GtkScale-slider-length: 16;
@ -192,4 +193,5 @@ GtkLevelBar {
} }
} }
} }
}
} }

View File

@ -5,7 +5,8 @@
! Scrollbar ! Scrollbar
************/ ************/
.scrollbar { @include exports("scrollbar") {
.scrollbar {
border: none; border: none;
padding: 0; padding: 0;
@ -39,18 +40,18 @@
border-color: transparent; border-color: transparent;
} }
} }
} }
.scrollbars-junction, .scrollbars-junction,
.scrollbar.trough { .scrollbar.trough {
border: none; border: none;
border-radius: 0; border-radius: 0;
background-color: $bg_color; background-color: $bg_color;
background-image: none; background-image: none;
} }
/* overlay scrollbar */ /* overlay scrollbar */
OsThumb, OsScrollbar { OsThumb, OsScrollbar {
color: shade($bg_color, 0.7); color: shade($bg_color, 0.7);
&:selected { background-color: $selected_bg_color; } &:selected { background-color: $selected_bg_color; }
@ -58,4 +59,5 @@ OsThumb, OsScrollbar {
&:active { background-color: $selected_bg_color; } &:active { background-color: $selected_bg_color; }
&:insensitive { background-color: shade($bg_color, 0.9); } &:insensitive { background-color: shade($bg_color, 0.9); }
}
} }

View File

@ -6,7 +6,8 @@
! Sidebar ! Sidebar
**********/ **********/
.sidebar { @include exports("sidebar") {
.sidebar {
&, &.view, & .view, & GtkScrolledWindow { &, &.view, & .view, & GtkScrolledWindow {
background-color: $bg_color; background-color: $bg_color;
color: mix($fg_color, $bg_color, 0.1); color: mix($fg_color, $bg_color, 0.1);
@ -70,6 +71,7 @@
.highlight { font: bold; } .highlight { font: bold; }
} }
}
} }
@ -77,7 +79,11 @@
! Pane separator ! Pane separator
****************/ ****************/
.pane-separator { @include exports("paneseparator") {
.pane-separator {
background-color: $bg_color;
color: transparent;
&, &.horizontal { &, &.horizontal {
background-image: linear-gradient(to bottom, background-image: linear-gradient(to bottom,
shade($bg_color, 0.8) 0%, shade($bg_color, 0.8) 0%,
@ -115,4 +121,5 @@
background-repeat: no-repeat; background-repeat: no-repeat;
background-position: center center; background-position: center center;
} }
}
} }

View File

@ -6,11 +6,12 @@
! Spinner animation ! Spinner animation
********************/ ********************/
@keyframes spin { @include exports("spinner") {
@keyframes spin {
to { -gtk-icon-transform: rotate(1turn); } to { -gtk-icon-transform: rotate(1turn); }
} }
.spinner { .spinner {
background-image: none; background-image: none;
background-color: $selected_bg_color; background-color: $selected_bg_color;
opacity: 0; // non spinning spinner makes no sense opacity: 0; // non spinning spinner makes no sense
@ -23,4 +24,5 @@
&:insensitive { opacity: 0.5; } &:insensitive { opacity: 0.5; }
} }
}
} }

View File

@ -6,11 +6,6 @@
! Check and Radio items ! Check and Radio items
************************/ ************************/
* {
-GtkCheckButton-indicator-size: 16;
-GtkCheckMenuItem-indicator-size: 14;
}
@mixin toggle($type) { @mixin toggle($type) {
background-image: none; background-image: none;
@ -53,14 +48,21 @@
} }
} }
.radio { @include toggle("radio"); } @include exports("checkradio") {
* {
-GtkCheckButton-indicator-size: 16;
-GtkCheckMenuItem-indicator-size: 14;
}
.check { @include toggle("checkbox"); } .radio { @include toggle("radio"); }
GtkIconView.content-view.cell.check { .check { @include toggle("checkbox"); }
GtkIconView.content-view.cell.check {
-gtk-icon-source: url("assets/grid-selection-unchecked.svg"); -gtk-icon-source: url("assets/grid-selection-unchecked.svg");
&:active { -gtk-icon-source: url("assets/grid-selection-checked.svg"); } &:active { -gtk-icon-source: url("assets/grid-selection-checked.svg"); }
}
} }
@ -68,7 +70,8 @@ GtkIconView.content-view.cell.check {
! Switch ! Switch
*********/ *********/
GtkSwitch { @include exports("switch") {
GtkSwitch {
padding: 0; padding: 0;
border-radius: $roundness; border-radius: $roundness;
font: bold condensed; font: bold condensed;
@ -101,4 +104,5 @@ GtkSwitch {
color: mix($fg_color, $bg_color, 0.5); color: mix($fg_color, $bg_color, 0.5);
} }
} }
}
} }

View File

@ -49,20 +49,21 @@
.menubar { -GtkToolbar-button-relief: normal; } .menubar { -GtkToolbar-button-relief: normal; }
} }
.toolbar { @include exports("toolbar") {
.toolbar {
@include toolbar($bg_color, $fg_color); @include toolbar($bg_color, $fg_color);
border-style: none; border-style: none;
} }
.header-bar { .header-bar {
@include toolbar($titlebar_bg_color, $titlebar_fg_color); @include toolbar($titlebar_bg_color, $titlebar_fg_color);
border-width: 0 0 1px 0; border-width: 0 0 1px 0;
border-style: solid; border-style: solid;
} }
.titlebar { .titlebar {
@include linear-gradient($titlebar_bg_color); @include linear-gradient($titlebar_bg_color);
border-radius: $roundness $roundness 0 0; border-radius: $roundness $roundness 0 0;
@ -112,4 +113,5 @@
icon-shadow: none; icon-shadow: none;
} }
} }
}
} }

View File

@ -6,7 +6,8 @@
! Generic views ! Generic views
****************/ ****************/
.view { @include exports("view") {
.view {
color: $text_color; color: $text_color;
background-color: $base_color; background-color: $base_color;
@ -16,9 +17,9 @@
} }
&:selected, &:selected:focus { @extend %selected_items; } &:selected, &:selected:focus { @extend %selected_items; }
} }
.cell { .cell {
border-width: 0; border-width: 0;
border-radius: 0; border-radius: 0;
@ -26,9 +27,9 @@
background-color: $selected_bg_color; background-color: $selected_bg_color;
color: $selected_fg_color; color: $selected_fg_color;
} }
} }
row { row {
&:selected { &:selected {
&, &:hover, &:focus { &, &:hover, &:focus {
-GtkWidget-focus-padding: 1; -GtkWidget-focus-padding: 1;
@ -40,9 +41,9 @@ row {
color: $selected_fg_color; color: $selected_fg_color;
} }
} }
} }
.content-view { .content-view {
&.view { &.view {
background-color: $base_color; background-color: $base_color;
@ -61,9 +62,9 @@ row {
font: smaller; font: smaller;
padding: 0 12px; padding: 0 12px;
} }
} }
GtkIconView { GtkIconView {
&.content-view.check { @extend .content-view.check; } &.content-view.check { @extend .content-view.check; }
&.view.cell { &.view.cell {
@ -75,46 +76,47 @@ GtkIconView {
color: $selected_fg_color; color: $selected_fg_color;
} }
} }
} }
.dim-label { .dim-label {
&, &.view { color: alpha(currentColor, 0.5); } &, &.view { color: alpha(currentColor, 0.5); }
} }
.dnd { border: 1px solid $selected_bg_color; } .dnd { border: 1px solid $selected_bg_color; }
.grip { background-color: transparent; } .grip { background-color: transparent; }
.arrow { color: alpha(currentColor, 0.7); } .arrow { color: alpha(currentColor, 0.7); }
.rubberband { .rubberband {
&, &.view, &.content-view.view { &, &.view, &.content-view.view {
border: 1px solid $selected_bg_color; border: 1px solid $selected_bg_color;
border-radius: 0; border-radius: 0;
background-color: alpha($selected_bg_color, 0.3); background-color: alpha($selected_bg_color, 0.3);
} }
} }
/* used by GtkScrolledWindow, shown when content is touch-dragged past boundaries. */ /* used by GtkScrolledWindow, shown when content is touch-dragged past boundaries. */
.overshoot { background-color: alpha($selected_bg_color, 0.3); } .overshoot { background-color: alpha($selected_bg_color, 0.3); }
GdMainIconView.content-view { -GdMainIconView-icon-size: 40; } GdMainIconView.content-view { -GdMainIconView-icon-size: 40; }
/* this will get overridden by .view, needed by gedit line numbers */ /* this will get overridden by .view, needed by gedit line numbers */
GtkTextView { background-color: mix($bg_color, $base_color, 0.50); } GtkTextView { background-color: mix($bg_color, $base_color, 0.50); }
GtkDrawingArea, GtkHTML { GtkDrawingArea, GtkHTML {
@extend .view; @extend .view;
&:insensitive { background-color: shade($base_color, 0.9); } &:insensitive { background-color: shade($base_color, 0.9); }
}
} }
/************ /************
! Treeview * ! Treeview *
*************/ *************/
GtkTreeView { @include exports("treeview") {
GtkTreeView {
-GtkTreeView-vertical-separator: 0; -GtkTreeView-vertical-separator: 0;
outline-offset: -1px; outline-offset: -1px;
@ -126,6 +128,7 @@ GtkTreeView {
background-color: $base_color; background-color: $base_color;
background-image: none; background-image: none;
} }
}
} }
@ -133,7 +136,8 @@ GtkTreeView {
! Column view headers ! Column view headers
**********************/ **********************/
column-header { @include exports("columnheader") {
column-header {
.button { .button {
&, &:active { &, &:active {
border-width: 0 1px 1px 0; border-width: 0 1px 1px 0;
@ -156,6 +160,7 @@ column-header {
&:last-child .button { border-width: 0 0 1px 0; } &:last-child .button { border-width: 0 0 1px 0; }
} }
}
} }
@ -163,13 +168,15 @@ column-header {
! Frames * ! Frames *
***********/ ***********/
.frame { border: none; } @include exports("frame") {
.frame { border: none; }
GtkScrolledWindow { GtkScrolledWindow {
&.frame { border: 1px solid border_normal($bg_color); } &.frame { border: 1px solid border_normal($bg_color); }
/* avoid double borders when a viewport is packed into a GtkScrolledWindow */ /* avoid double borders when a viewport is packed into a GtkScrolledWindow */
GtkViewport.frame { border: none; } GtkViewport.frame { border: none; }
}
} }
@ -177,12 +184,13 @@ GtkScrolledWindow {
! Expanders * ! Expanders *
**************/ **************/
GtkExpander { @include exports("expander") {
GtkExpander {
padding: $spacing; padding: $spacing;
outline-offset: 1px; outline-offset: 1px;
} }
.expander { .expander {
color: alpha(currentColor, 0.7); color: alpha(currentColor, 0.7);
border: alpha(currentColor, 0.7); border: alpha(currentColor, 0.7);
@ -195,6 +203,7 @@ GtkExpander {
color: alpha(currentColor, 0.9); color: alpha(currentColor, 0.9);
border-color: alpha(currentColor, 0.9); border-color: alpha(currentColor, 0.9);
} }
}
} }
@ -202,22 +211,14 @@ GtkExpander {
! Symbolic images * ! Symbolic images *
********************/ ********************/
.image { @include exports("symbolicimage") {
.image {
color: alpha(currentColor, 0.5); color: alpha(currentColor, 0.5);
&:hover { color: alpha(currentColor, 0.9); } &:hover { color: alpha(currentColor, 0.9); }
&:selected, &:selected:hover { color: $selected_fg_color; } &:selected, &:selected:hover { color: $selected_fg_color; }
} }
/******************
! Pane separator *
*******************/
.pane-separator {
background-color: $bg_color;
color: transparent;
} }
@ -225,7 +226,8 @@ GtkExpander {
! Floating bar * ! Floating bar *
*****************/ *****************/
.floating-bar { @include exports("floatingbar") {
.floating-bar {
border: 1px solid border_normal($bg_color); border: 1px solid border_normal($bg_color);
border-radius: $roundness; border-radius: $roundness;
background-color: $bg_color; background-color: $bg_color;
@ -264,4 +266,5 @@ GtkExpander {
background-color: transparent; background-color: transparent;
background-image: none; background-image: none;
} }
}
} }

View File

@ -6,7 +6,8 @@
! Window frame ! Window frame
***************/ ***************/
.window-frame { @include exports("window") {
.window-frame {
border: none; border: none;
border-radius: $roundness $roundness 0 0; border-radius: $roundness $roundness 0 0;
box-shadow: 0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23), box-shadow: 0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23),
@ -40,4 +41,5 @@
0 0 0 1px mix(shade($titlebar_bg_color, 0.7), $titlebar_fg_color, 0.21); 0 0 0 1px mix(shade($titlebar_bg_color, 0.7), $titlebar_fg_color, 0.21);
} }
} }
}
} }

View File

@ -17,78 +17,6 @@
@import "notebook"; @import "notebook";
@import "scrollbar"; @import "scrollbar";
/*************
* scrollbar *
*************/
.scrollbar {
border-width: 1px;
border-style: solid;
padding: 0;
}
.scrollbars-junction,
.scrollbar.trough {
border-width: 0;
border-radius: 0;
background-color: $bg_color;
background-image: none;
}
.scrollbar.button,
.scrollbar.button:active,
.scrollbar.button:active:hover {
border-width: 0;
border-radius: 0;
background-color: transparent;
background-image: none;
color: shade($bg_color, 0.6);
}
.scrollbar.slider {
border-width: 1px;
border-color: mix(shade($bg_color, 0.87), $fg_color, 0.21);
border-radius: 0;
background-color: mix($bg_color, $fg_color, 0.21);
}
.scrollbar.slider:hover,
.scrollbar.slider.vertical:hover {
border-color: mix(shade($bg_color, 0.87), $fg_color, 0.31);
background-color: mix($bg_color, $fg_color, 0.31);
}
.scrollbar.slider:active,
.scrollbar.slider.vertical:active {
border-color: shade($selected_bg_color, 0.9);
background-color: $selected_bg_color;
}
.scrollbar.slider.fine-tune:prelight:active {
border-width: 2px;
border-color: transparent;
}
/* overlay scrollbar */
OsThumb {
color: shade($bg_color, 0.7);
}
OsThumb:selected,
OsScrollbar:selected {
background-color: $selected_bg_color;
}
OsThumb:active,
OsScrollbar:active {
background-color: $selected_bg_color;
}
OsThumb:insensitive,
OsScrollbar:insensitive {
background-color: shade($bg_color, 0.9);
}
/************* /*************
* separator * * separator *
*************/ *************/