/* GTK3 WIDGET STYLING */


/*
 * Keep in order of:
 *   General -> Specific
 *   Order of appearance in widget tree.
 *   See GtkInspector
 *     GTK_DEBUG=interactive ~/path_to_gtk3/bin/inkscape
 *
 * We need a standardized naming scheme.
 *
 * As of Gtk 3.20, you cannot use widget names.
 */


/* Standard theme based colors. Prefer these.
 *
 * @theme_bg_color
 * @theme_fg_color
 * @theme_base_color
 * @theme_text_color
 * @theme_selected_bg_color
 * @theme_selected_fg_color
 * @theme_tooltip_bg_color
 * @theme_tooltip_fg_color
 *
 */


/* Our own custom shades... better not to use.
 * Lightest to darkest based on linear rgb.
 */

@define-color bg_color0 #ffffff;

/* White */

@define-color bg_color05 #f8f8f8;

/* Slightly off white */

@define-color bg_color1 #f0f0f0;
@define-color bg_color2 #e0e0e0;
@define-color bg_color3 #d0d0d0;
@define-color bg_color4 #bbbbbb;

/* 50% Gray */

@define-color bg_color5 #a5a5a5;
@define-color bg_color6 #898989;
@define-color bg_color7 #636363;
@define-color bg_color8 #000000;

/* Black */


/* Inkscape CSS helper
    * to add a class to a widget do some thing like
    * widget->get_style_context()->add_class("mycoolclass");
    * we define a bunch of helper CSS styles
    * Each Inkscape desktop has some classes in top level window
    * called "dark|bright" and "symbolic|regular" so you can style using this clases 
    * by this way you can always know if the UI is in dark mode
    * Also added some helper clases:
    * ::::::: Color based
    * ::::::: apply to colors
    * ::::::: scope widget and all his childs
    * ".inverted" invert colors
    * :::::::: Icon Based.
    * ".symbolic" Force icon symbolic
    * ".regular" Force colorful icons
    * :::::::: Combo box.
    * "..combobright" Combo bright
    */

*:disabled image {
    opacity: 0.4;
}

image {
    color: @theme_fg_color;
    -gtk-icon-palette: default;
}

.symbolic image {
    -gtk-icon-style: symbolic;
}

.regular image {
    -gtk-icon-style: regular;
}

.inverted,
.dark .forcebright,
.bright .forcedark {
    color: @theme_bg_color;
    background-color: @theme_fg_color;
    background-image: image(@theme_fg_color);
    caret-color: @theme_bg_color;
    -gtk-secondary-caret-color: @theme_fg_color;
}

.inverted :not(menuitem):not(.rawstyle):not(overshoot):not(undershoot):not(selection),
.bright .forcedark :not(menuitem):not(.rawstyle):not(overshoot):not(undershoot):not(selection),
.dark .forcebright :not(menuitem):not(.rawstyle):not(overshoot):not(undershoot):not(selection) {
    color: inherit;
    background-color: inherit;
    background-image: inherit;
}

.combobright * {
    color: @theme_text_color;
    background-color: @theme_base_color;
    background-image: image(@theme_base_color);
    border-radius: 4px;
}

.dark .combobright * {
    color: @theme_base_color;
    background-color: @theme_text_color;
    background-image: image(@theme_text_color);
    border-radius: 4px;
}

.attrpop textview {
    font-size: 13px;
}


/* 
*to get system default colors
* with Gdk::RGBA success =_symbolic_error_color.get_stseparatole_context()->get_color();
* _symbolic_error_color has one of this calsses applied
*/

.system_base_color {
    color: @theme_fg_color;
    background-color: @theme_bg_color;
}

.system_error_color {
    color: @error_color;
}

.system_warning_color {
    color: @warning_color;
}

.system_success_color {
    color: @success_color;
}

image.disabled,
.symboliccolors:disabled * {
    opacity: 0.35;
}

spinbutton {
    padding: 0;
    outline-style: none;
}

spinbutton entry {
    padding-left: 2px;
    padding-right: 0;
}

spinbutton undershoot {
    outline-style: none;
}

spinbutton entry {
    padding-left: 2px;
    padding-right: 0;
}

iconview *:hover {
    border-width: 1px;
    border-color: @theme_fg_color;
    border-style: solid;
    border-radius: 4px;
}

.dark iconview *:hover {
    border-color: @theme_bg_color;
}

spinbutton undershoot {
    outline-style: none;
}

#LPEDialogSelector,
#LPEDialogSelector .frame,
#LPEDialogSelector .searchbar {
    outline-width: 0;
    border-width: 0;
}

#LPESelectorFlowBox GtkFlowBoxChild,
#LPESelectorFlowBox flowboxchild {
    border-width: 0px;
    border-radius: 6px;
    margin: 10px;
    padding: 10px;
    margin-bottom: 0px;
    padding-bottom: 10px;
    outline: none;
}

#LPESelectorFlowBox flowboxchild * {
    color: @theme_fg_color;
}

#LPESelectorFlowBox flowboxchild:selected image,
#LPESelectorFlowBox flowboxchild:selected label {
    color: @theme_selected_fg_color;
    background-color: @theme_selected_bg_color;
    background-image: image(@theme_selected_bg_color);
}

#LPESelectorFlowBox *:selected #LPESelectorEffectFavTop,
#LPESelectorFlowBox *:selected:focus #LPESelectorEffectFavTop {
    opacity: 0;
}

#LPESelectorFlowBox .lpename {
    font-size: 16px;
    margin-bottom: 5px;
}

#LPESelectorFlowBox .lpeinfo {
    font-size: 16px;
    padding: 20px;
}

#LPESelectorFlowBox .lpedisabled {
    opacity: 0.3;
}

#LPESelectorEffectInfoPop {
    padding: 15px;
}

#LPESelectorEffectInfoName {
    font-weight: bold;
    padding: 15px;
}

#LPEDialogSelector .lpeinfo {
    padding: 8px;
    background-color: @theme_selected_fg_color;
    color: @theme_selected_bg_color;
    margin: 10px 10px 0px 10px;
    border-radius: 5px;
}

#LPEExperimental image {
    color: transparent;
}

#LPEDialogSelector .searchbar entry image,
#LPEDialogSelector .searchbar label,
#LPEDialogSelector .searchbar #LPESelectorEffectFavShowImage {
    color: @theme_fg_color;
}

#SelectorsAndStyleDialog button {
    padding: 4px;
    min-height: 16px;
    margin: 2px;
    padding: 2px;
}

.inksmall {
    font-size: 11px;
}

.inkswitch slider {
    min-width: 18px;
    min-height: 18px;
}

.inkswitch image {
    color: transparent;
    background-color: transparent;
    background-image: image(transparent);
    -gtk-icon-style:symbolic;
}

.inkswitch {
    margin: 2px;
    padding: 0;
    font-size: 8px;
}


#XMLAndAttributesDialog .toggle,
#SelectorsAndStyleDialog .toggle {
    min-width: 18px;
    padding-left: 6px;
    padding-right: 6px;
    padding-top: 0;
    padding-bottom: 0;
}

#XMLAndAttributesDialog .radio.image-button,
#SelectorsAndStyleDialog .radio.image-button {
    margin: 0;
    padding: 0px;
    border-radius: 2px 0 0 2px;
}

#XMLAndAttributesDialog .radio.image-button:last-child,
#SelectorsAndStyleDialog .radio.image-button:last-child {
    border-radius: 0 2px 2px 0;
    border-left-width: 0;
}

#SelectorsAndStyleDialog treeview button {
    border-width: 0;
    margin: 0 0 1px 0;
}

#SelectorsAndStyleDialog treeview button:nth-child(3),
#SelectorsAndStyleDialog treeview.style_sheet button:nth-child(4) {
    border-width: 0 0 0 2px;
    border-color: @theme_fg_color;
    border-style: solid;
    opacity: 0.5;
}

#SelectorsAndStyleDialog treeview.style_sheet button:nth-child(3) {
    border-width: 0;
}

#SelectorsAndStyleDialog treeview button {
    min-height: 3px;
    font-size: 1px;
}

#InkRuler {
    font-size: 7pt;
}


/* The actual canvas (Inkscape's drawing area). */

SPCanvas {
    background-color: white;
}

combobox window.popup scrolledwindow treeview separator {}

#font_selector_family {}

#TextFontFamilyAction_combobox {
    -GtkComboBox-appears-as-list: true;
}

#LockGuides,
#StickyZoom,
#CMS_Adjust {
    padding: 0;
}


/* Keep palette scrollbar from generating warnings. */

#PreviewHolderScroller .vertical slider {
    min-height: 15px;
}


/* Override minimum size of container children for palette. */

#ColorItemPreview {
    min-height: 5px;
    min-width: 5px;
}


/* Reduce width of Fill and Stroke dialog */

#ColorModeButton {
    padding-left: 0;
    padding-right: 0;
}


/* Reduce width of +/- buttons. */

.up,
.down {
    padding-left: 0;
    padding-right: 0;
}


/* InkSpinScale */

#InkSpinScale {
    background: @theme_bg_color;
    border: 1px black;
    border-radius: 3px;
    padding: 0px;
}

#InkSpinScale spinbutton {
    border-color: #eee;
    border-width: 0 0 0 0;
    border-radius: 0 3px 3px 0;
    box-shadow: none;
    padding: 0 0 0 1px;
    min-height: 10px;
}


/* Hide slider */

#InkSpinScale slider {
    background: none;
    border: none;
    outline: none;
    min-width: 0px;
    min-height: 0px;
    padding: 0px;
    margin: 0px;
}

#InkSpinScale slider,
#InkSpinScale highlight {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

#InkSpinScale scale {
    padding: 0px;
}

#InkSpinScale trough {
    min-height: 30px;
}

#InkSpinScale box.active {
    box-shadow: 0 0 0 1px rgb(74, 144, 217);
}

#InkSpinScale spinbutton entry {
    padding: 0;
    outline-style: none;
}
