From e03e412f40a8d83df4c79fdcfc12c7a0f76bdf6b Mon Sep 17 00:00:00 2001
From: progandy <code@progandy>
Date: Mon, 20 Oct 2014 10:22:07 +0200
Subject: [PATCH] Essential support for radio and checkbox

Supports sticky button, indeterminate radio and indeterminate checkbox.
This requires the following icons in your icon theme.
 * checkbox-checked-symbolic.svg
 * checkbox-mixed-symbolic.svg
 * checkbox-symbolic.svg
 * radio-checked-symbolic.svg
 * radio-mixed-symbolic.svg
 * radio-symbolic.svg
Fallback icons are available in the Adwaita icon theme.
---
 gtk-3.0/scss/_button.scss |  4 +++-
 gtk-3.0/scss/_toggle.scss | 40 +++++++++++++++++++++++++++++++++++++++
 gtk-3.0/scss/widgets.scss |  1 +
 3 files changed, 44 insertions(+), 1 deletion(-)
 create mode 100644 gtk-3.0/scss/_toggle.scss

diff --git a/gtk-3.0/scss/_button.scss b/gtk-3.0/scss/_button.scss
index fe017a6..8efdfdc 100644
--- a/gtk-3.0/scss/_button.scss
+++ b/gtk-3.0/scss/_button.scss
@@ -88,9 +88,11 @@
 		box-shadow: 0 1px 3px -1px alpha($dark_shadow, .5);
 	}
 
-	&:active {
+	&:checked, &:active {
 		@include linear-gradient(shade($bg, .95));
+	}
 
+	&:active {
 		box-shadow: inset 1px 0 alpha($dark_shadow, .07),
 					inset 0 1px alpha($dark_shadow, .08),
 					inset -1px 0 alpha($dark_shadow, .07),
diff --git a/gtk-3.0/scss/_toggle.scss b/gtk-3.0/scss/_toggle.scss
new file mode 100644
index 0000000..a3af16a
--- /dev/null
+++ b/gtk-3.0/scss/_toggle.scss
@@ -0,0 +1,40 @@
+/*************************
+ * Check and Radio items *
+ *************************/
+@mixin toggle($type, $bg, $fg) {
+	color: $fg;
+	background-image: none;
+	-gtk-icon-source: -gtk-icontheme('#{$type}-symbolic');
+
+	&:checked, &:active {
+	    -gtk-icon-source: -gtk-icontheme('#{$type}-checked-symbolic');
+	}
+
+	&:inconsistent {
+	    -gtk-icon-source: -gtk-icontheme('#{$type}-mixed-symbolic');
+	}
+
+	&:focus, &:hover {
+	    color: shade($fg, 1.2);
+	}
+
+	&:active {
+	    color: shade($fg, 0.8);
+	}
+
+	&:insensitive {
+	    color: mix($bg, $fg, .5);
+	}
+
+	&:active *:insensitive {
+	    color: mix($bg, $fg, .8);
+	}
+
+}
+
+.radio {
+	@include toggle("radio", $bg_color, $fg_color);
+}
+.check {
+	@include toggle("checkbox", $bg_color, $fg_color);
+}
diff --git a/gtk-3.0/scss/widgets.scss b/gtk-3.0/scss/widgets.scss
index 09c5ce7..1780fbc 100644
--- a/gtk-3.0/scss/widgets.scss
+++ b/gtk-3.0/scss/widgets.scss
@@ -1,6 +1,7 @@
 @import "colors";
 @import "base";
 @import "button";
+@import "toggle";
 @import "entry";
 @import "menu";
 @import "toolbar";