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,6 +145,7 @@
.linked & { @include linked_button($bg, $dark_shadow); } .linked & { @include linked_button($bg, $dark_shadow); }
} }
@include exports("button") {
%close_button { %close_button {
border: 1px solid transparent; border: 1px solid transparent;
background-color: transparent; background-color: transparent;
@ -171,3 +172,4 @@
&.default { @include button($selected_bg_color, $selected_fg_color); } &.default { @include button($selected_bg_color, $selected_fg_color); }
} }
}

View File

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

View File

@ -72,13 +72,16 @@
&.image.left { padding-right: $spacing; } &.image.left { padding-right: $spacing; }
} }
@include exports("entry") {
.entry { @include entry($base_color, $text_color); } .entry { @include entry($base_color, $text_color); }
}
/****************** /******************
! Combobox entry * ! Combobox entry *
*******************/ *******************/
@include exports("comboboxentry") {
GtkComboBox.combobox-entry { GtkComboBox.combobox-entry {
.entry { .entry {
&, &:hover, &:focus, &:active, &:insensitive { &, &:hover, &:focus, &:active, &:insensitive {
@ -96,3 +99,5 @@ GtkComboBox.combobox-entry {
} }
} }
} }
}

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,6 +7,7 @@
! Infobar ! Infobar
**********/ **********/
@include exports("infobar") {
GtkInfoBar { GtkInfoBar {
border: none; border: none;
@ -36,3 +37,4 @@ GtkInfoBar {
} }
} }
} }
}

View File

@ -7,6 +7,7 @@
! Menubar ! Menubar
**********/ **********/
@include exports("menubar") {
.menubar { .menubar {
-GtkWidget-window-dragging: true; -GtkWidget-window-dragging: true;
@ -33,12 +34,14 @@
& *:hover { color: shade($menubar_fg_color, 1.08); } & *:hover { color: shade($menubar_fg_color, 1.08); }
} }
} }
}
/****** /******
! Menu ! Menu
*******/ *******/
@include exports("menu") {
GtkTreeMenu, GtkMenuToolButton, GtkComboBox { GtkTreeMenu, GtkMenuToolButton, GtkComboBox {
&.menu, .menu { &.menu, .menu {
background-color: $menu_bg_color; background-color: $menu_bg_color;
@ -150,12 +153,14 @@ GtkTreeMenu, GtkMenuToolButton, GtkComboBox {
} }
GtkModelMenuItem GtkBox GtkImage { padding-right: $spacing; } GtkModelMenuItem GtkBox GtkImage { padding-right: $spacing; }
}
/********* /*********
! Popover ! Popover
**********/ **********/
@include exports("popover") {
GtkPopover { GtkPopover {
@include border($menu_bg_color); @include border($menu_bg_color);
@ -221,3 +226,4 @@ GtkModelButton.button {
border-radius: 2px; border-radius: 2px;
} }
} }
}

View File

@ -1,10 +1,12 @@
@import "functions"; @import "functions";
@import "global"; @import "global";
/********** /**********
! Notebook ! Notebook
***********/ ***********/
@include exports("notebook") {
.notebook { .notebook {
padding: 0; padding: 0;
border-width: 1px 0 0 0; border-width: 1px 0 0 0;
@ -132,3 +134,4 @@
} }
} }
} }
}

View File

@ -6,6 +6,7 @@
! Progress bars * ! Progress bars *
******************/ ******************/
@include exports("progressbar") {
GtkProgressBar { GtkProgressBar {
padding: 0; padding: 0;
border-radius: $roundness; border-radius: $roundness;
@ -193,3 +194,4 @@ GtkLevelBar {
} }
} }
} }
}

View File

@ -5,6 +5,7 @@
! Scrollbar ! Scrollbar
************/ ************/
@include exports("scrollbar") {
.scrollbar { .scrollbar {
border: none; border: none;
padding: 0; padding: 0;
@ -59,3 +60,4 @@ OsThumb, OsScrollbar {
&:insensitive { background-color: shade($bg_color, 0.9); } &:insensitive { background-color: shade($bg_color, 0.9); }
} }
}

View File

@ -6,6 +6,7 @@
! Sidebar ! Sidebar
**********/ **********/
@include exports("sidebar") {
.sidebar { .sidebar {
&, &.view, & .view, & GtkScrolledWindow { &, &.view, & .view, & GtkScrolledWindow {
background-color: $bg_color; background-color: $bg_color;
@ -71,13 +72,18 @@
.highlight { font: bold; } .highlight { font: bold; }
} }
} }
}
/*************** /***************
! Pane separator ! Pane separator
****************/ ****************/
@include exports("paneseparator") {
.pane-separator { .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%,
@ -116,3 +122,4 @@
background-position: center center; background-position: center center;
} }
} }
}

View File

@ -6,6 +6,7 @@
! Spinner animation ! Spinner animation
********************/ ********************/
@include exports("spinner") {
@keyframes spin { @keyframes spin {
to { -gtk-icon-transform: rotate(1turn); } to { -gtk-icon-transform: rotate(1turn); }
} }
@ -24,3 +25,4 @@
&: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,6 +48,12 @@
} }
} }
@include exports("checkradio") {
* {
-GtkCheckButton-indicator-size: 16;
-GtkCheckMenuItem-indicator-size: 14;
}
.radio { @include toggle("radio"); } .radio { @include toggle("radio"); }
.check { @include toggle("checkbox"); } .check { @include toggle("checkbox"); }
@ -62,12 +63,14 @@ GtkIconView.content-view.cell.check {
&:active { -gtk-icon-source: url("assets/grid-selection-checked.svg"); } &:active { -gtk-icon-source: url("assets/grid-selection-checked.svg"); }
} }
}
/******** /********
! Switch ! Switch
*********/ *********/
@include exports("switch") {
GtkSwitch { GtkSwitch {
padding: 0; padding: 0;
border-radius: $roundness; border-radius: $roundness;
@ -102,3 +105,4 @@ GtkSwitch {
} }
} }
} }
}

View File

@ -49,6 +49,7 @@
.menubar { -GtkToolbar-button-relief: normal; } .menubar { -GtkToolbar-button-relief: normal; }
} }
@include exports("toolbar") {
.toolbar { .toolbar {
@include toolbar($bg_color, $fg_color); @include toolbar($bg_color, $fg_color);
@ -113,3 +114,4 @@
} }
} }
} }
}

View File

@ -6,6 +6,7 @@
! Generic views ! Generic views
****************/ ****************/
@include exports("view") {
.view { .view {
color: $text_color; color: $text_color;
background-color: $base_color; background-color: $base_color;
@ -108,12 +109,13 @@ GtkDrawingArea, GtkHTML {
&:insensitive { background-color: shade($base_color, 0.9); } &:insensitive { background-color: shade($base_color, 0.9); }
} }
}
/************ /************
! Treeview * ! Treeview *
*************/ *************/
@include exports("treeview") {
GtkTreeView { GtkTreeView {
-GtkTreeView-vertical-separator: 0; -GtkTreeView-vertical-separator: 0;
@ -127,12 +129,14 @@ GtkTreeView {
background-image: none; background-image: none;
} }
} }
}
/********************* /*********************
! Column view headers ! Column view headers
**********************/ **********************/
@include exports("columnheader") {
column-header { column-header {
.button { .button {
&, &:active { &, &:active {
@ -157,12 +161,14 @@ column-header {
&:last-child .button { border-width: 0 0 1px 0; } &:last-child .button { border-width: 0 0 1px 0; }
} }
} }
}
/********** /**********
! Frames * ! Frames *
***********/ ***********/
@include exports("frame") {
.frame { border: none; } .frame { border: none; }
GtkScrolledWindow { GtkScrolledWindow {
@ -171,12 +177,14 @@ GtkScrolledWindow {
/* 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; }
} }
}
/************* /*************
! Expanders * ! Expanders *
**************/ **************/
@include exports("expander") {
GtkExpander { GtkExpander {
padding: $spacing; padding: $spacing;
outline-offset: 1px; outline-offset: 1px;
@ -196,12 +204,14 @@ GtkExpander {
border-color: alpha(currentColor, 0.9); border-color: alpha(currentColor, 0.9);
} }
} }
}
/******************* /*******************
! Symbolic images * ! Symbolic images *
********************/ ********************/
@include exports("symbolicimage") {
.image { .image {
color: alpha(currentColor, 0.5); color: alpha(currentColor, 0.5);
@ -209,15 +219,6 @@ GtkExpander {
&: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,6 +226,7 @@ GtkExpander {
! Floating bar * ! Floating bar *
*****************/ *****************/
@include exports("floatingbar") {
.floating-bar { .floating-bar {
border: 1px solid border_normal($bg_color); border: 1px solid border_normal($bg_color);
border-radius: $roundness; border-radius: $roundness;
@ -265,3 +267,4 @@ GtkExpander {
background-image: none; background-image: none;
} }
} }
}

View File

@ -6,6 +6,7 @@
! Window frame ! Window frame
***************/ ***************/
@include exports("window") {
.window-frame { .window-frame {
border: none; border: none;
border-radius: $roundness $roundness 0 0; border-radius: $roundness $roundness 0 0;
@ -41,3 +42,4 @@
} }
} }
} }
}

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 *
*************/ *************/