[libadwaita/wip/exalm/list-focus: 2/2] stylesheet: Make : in focus-state explicit




commit d5491831614a5fac27610d67ce76892e1962ecfe
Author: Alexander Mikhaylenko <alexm gnome org>
Date:   Sun Aug 1 18:36:09 2021 +0500

    stylesheet: Make : in focus-state explicit
    
    This will allow to pass states such as style classes later.

 src/stylesheet/_drawing.scss          | 4 ++--
 src/stylesheet/widgets/_calendar.scss | 2 +-
 src/stylesheet/widgets/_entries.scss  | 4 ++--
 src/stylesheet/widgets/_notebook.scss | 2 +-
 4 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/src/stylesheet/_drawing.scss b/src/stylesheet/_drawing.scss
index 1a55d9a0..385d3dc1 100644
--- a/src/stylesheet/_drawing.scss
+++ b/src/stylesheet/_drawing.scss
@@ -9,7 +9,7 @@
 // If $outer is true, the focus ring extends outward. Otherwise, it extends inward.
 // If $within is true, use focus-within instead of focus:focus-visible
 //
-@mixin focus-ring($target: null, $width: 2px, $offset: -$width, $outer: false, $focus-state: 
'focus:focus-visible', $fc: $focus_border_color) {
+@mixin focus-ring($target: null, $width: 2px, $offset: -$width, $outer: false, $focus-state: 
':focus:focus-visible', $fc: $focus_border_color) {
   transition-property: outline, outline-width, outline-offset, outline-color;
   transition-duration: 300ms;
   animation-timing-function: ease-in-out;
@@ -18,7 +18,7 @@
     outline-offset: if($outer, $offset + 4px, $offset + $width + 4px);
   }
 
-  &:#{$focus-state} #{$target} {
+  &#{$focus-state} #{$target} {
     outline-color: $fc;
     outline-width: $width;
     outline-offset: $offset;
diff --git a/src/stylesheet/widgets/_calendar.scss b/src/stylesheet/widgets/_calendar.scss
index baf8a6e2..9ba47475 100644
--- a/src/stylesheet/widgets/_calendar.scss
+++ b/src/stylesheet/widgets/_calendar.scss
@@ -22,7 +22,7 @@ calendar {
     }
 
     > label {
-      @include focus-ring($focus-state: 'focus');
+      @include focus-ring($focus-state: ':focus');
 
       &.day-number {
         padding: 4px;
diff --git a/src/stylesheet/widgets/_entries.scss b/src/stylesheet/widgets/_entries.scss
index e2c1d693..f4753954 100644
--- a/src/stylesheet/widgets/_entries.scss
+++ b/src/stylesheet/widgets/_entries.scss
@@ -12,7 +12,7 @@ entry {
 
     @include entry(normal);
 
-    @include focus-ring($focus-state: 'focus-within');
+    @include focus-ring($focus-state: ':focus-within');
 
     > text {
       > placeholder {
@@ -42,7 +42,7 @@ entry {
       &.#{$e_type} {
         color: gtkmix($e_color, $text_color, 70%);
 
-        @include focus-ring($focus-state: 'focus-within', $fc: gtkalpha($e_color, 0.5));
+        @include focus-ring($focus-state: ':focus-within', $fc: gtkalpha($e_color, 0.5));
 
         > text {
           > selection:focus-within { background-color: gtkalpha($e_color, .2); }
diff --git a/src/stylesheet/widgets/_notebook.scss b/src/stylesheet/widgets/_notebook.scss
index 777a8791..db476d28 100644
--- a/src/stylesheet/widgets/_notebook.scss
+++ b/src/stylesheet/widgets/_notebook.scss
@@ -1,5 +1,5 @@
 notebook {
-  @include focus-ring("> header > tabs > tab:checked", $offset: -2px, $focus-state: 'focus:focus-visible');
+  @include focus-ring("> header > tabs > tab:checked", $offset: -2px, $focus-state: ':focus:focus-visible');
 
   > header {
     padding: 1px;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]