A fork of the Materia GTK theme.

By using this site, you agree to have cookies stored on your device, strictly for functional purposes, such as storing your session and preferences.

Dismiss

GTK3: Restyle the switches so as to be close to Material Design

roundabout,
created on Thursday, 3 March 2016, 13:13:21 (1457010801), received on Sunday, 11 May 2025, 13:21:55 (1746969715)
Author identity: nana4 <hnmaigo@gmail.com>

b61e772f64abffe258c0c8ba2ab84b2c661bf88c

gtk-3.0/_common.scss

@@ -1362,16 +1362,15 @@ $_slider_fine_tune_margin: 6px;

                                
                                
                                
                            
                                
                                    
                                        
                                            
                                             **********/
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            GtkSwitch {
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                          -GtkSwitch-slider-width: 28px; // 55px is the right value to make it as tall
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                                         // as buttons, not doing that for now
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                          -GtkSwitch-slider-height: 28px;
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                          -GtkSwitch-slider-width: $small_size;
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                          -GtkSwitch-slider-height: $small_size;
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                              outline-offset: -4px;
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                              outline-radius: 100px;
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                              font-size: 0;
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                              &.trough {
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                // similar to the .scale
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            border: 10px solid transparent;
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            border: 8px solid transparent;
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                border-radius: 100px;
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                background-color: $track_color;
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                // background-clip: padding-box;
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        

@@ -1379,10 +1378,11 @@ GtkSwitch {

                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                  color: $insensitive_fg_color;
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                }
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                &:active {
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                              background-color: $accent_bg_color;
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                              background-color: scale-alpha($accent_bg_color, 0.5);
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                              color: $selected_fg_color;
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                  &:insensitive {
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                background-color: $track_color;
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                color: $accent_bg_color;
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                background-color: scale-alpha($accent_bg_color, 0.5 * $disabled_opacity);
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                color: $insensitive_fg_color;
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                  }
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                }
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                              }
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        

@@ -1391,6 +1391,7 @@ GtkSwitch {

                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                border-radius: 100px;
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                @include entry(normal);
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                &:hover { @include entry(focus); }
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            &:active { background-color: $accent_bg_color; }
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                &:insensitive { @include entry(insensitive); }
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                              }
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                              .list-row:selected & {
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                            
                                

gtk-3.0/gtk-dark.css

@@ -1118,22 +1118,23 @@ column-header.button.dnd, column-header .button.dnd {

                                
                                
                                
                            
                                
                                    
                                        
                                            
                                             * Switch *
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                             **********/
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            GtkSwitch {
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                          -GtkSwitch-slider-width: 28px;
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                          -GtkSwitch-slider-height: 28px;
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                          -GtkSwitch-slider-width: 24px;
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                          -GtkSwitch-slider-height: 24px;
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                              outline-offset: -4px;
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                              outline-radius: 100px;
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                              font-size: 0; }
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                              GtkSwitch.trough {
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            border: 10px solid transparent;
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            border: 8px solid transparent;
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                border-radius: 100px;
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                background-color: alpha(currentColor, 0.3); }
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                GtkSwitch.trough:insensitive {
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                  color: rgba(255, 255, 255, 0.4); }
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                GtkSwitch.trough:active {
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                              background-color: #FF4081; }
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                              background-color: rgba(255, 64, 129, 0.5);
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                              color: #FFFFFF; }
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                  GtkSwitch.trough:active:insensitive {
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                background-color: alpha(currentColor, 0.3);
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                color: #FF4081; }
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                background-color: rgba(255, 64, 129, 0.2);
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                color: rgba(255, 255, 255, 0.4); }
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                              GtkSwitch.slider {
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                padding: 4px;
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                border-radius: 100px;
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        

@@ -1142,6 +1143,8 @@ GtkSwitch {

                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                color: #FFFFFF; }
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                GtkSwitch.slider:hover {
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                  box-shadow: 0 3px 3px rgba(0, 0, 0, 0.16), 0 3px 3px rgba(0, 0, 0, 0.23); }
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            GtkSwitch.slider:active {
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                              background-color: #FF4081; }
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                GtkSwitch.slider:insensitive {
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                  color: rgba(255, 255, 255, 0.4);
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                  background-color: #3e515a; }
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                            
                                

gtk-3.0/gtk.css

@@ -1118,22 +1118,23 @@ column-header.button.dnd, column-header .button.dnd {

                                
                                
                                
                            
                                
                                    
                                        
                                            
                                             * Switch *
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                             **********/
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            GtkSwitch {
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                          -GtkSwitch-slider-width: 28px;
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                          -GtkSwitch-slider-height: 28px;
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                          -GtkSwitch-slider-width: 24px;
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                          -GtkSwitch-slider-height: 24px;
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                              outline-offset: -4px;
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                              outline-radius: 100px;
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                              font-size: 0; }
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                              GtkSwitch.trough {
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            border: 10px solid transparent;
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            border: 8px solid transparent;
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                border-radius: 100px;
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                background-color: alpha(currentColor, 0.3); }
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                GtkSwitch.trough:insensitive {
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                  color: rgba(0, 0, 0, 0.32); }
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                GtkSwitch.trough:active {
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                              background-color: #FF4081; }
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                              background-color: rgba(255, 64, 129, 0.5);
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                              color: #FFFFFF; }
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                  GtkSwitch.trough:active:insensitive {
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                background-color: alpha(currentColor, 0.3);
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                color: #FF4081; }
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                background-color: rgba(255, 64, 129, 0.2);
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                color: rgba(0, 0, 0, 0.32); }
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                              GtkSwitch.slider {
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                padding: 4px;
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                border-radius: 100px;
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        

@@ -1142,6 +1143,8 @@ GtkSwitch {

                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                color: rgba(0, 0, 0, 0.8); }
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                GtkSwitch.slider:hover {
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                  box-shadow: 0 3px 3px rgba(0, 0, 0, 0.16), 0 3px 3px rgba(0, 0, 0, 0.23); }
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            GtkSwitch.slider:active {
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                              background-color: #FF4081; }
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                GtkSwitch.slider:insensitive {
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                  color: rgba(0, 0, 0, 0.32);
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                  background-color: #f6f7f8; }