[libadwaita/wip/exalm/stylesheet2: 61/97] stylesheet: Split link styles into a separate file




commit 0c517077fc4d94b2d7547ae8a3d23d8b4bc82f9f
Author: Alexander Mikhaylenko <alexm gnome org>
Date:   Fri Apr 9 12:44:55 2021 +0500

    stylesheet: Split link styles into a separate file

 src/stylesheet/_common.scss        | 55 --------------------------------------
 src/stylesheet/_widgets.scss       |  1 +
 src/stylesheet/meson.build         |  1 +
 src/stylesheet/widgets/_links.scss | 49 +++++++++++++++++++++++++++++++++
 4 files changed, 51 insertions(+), 55 deletions(-)
---
diff --git a/src/stylesheet/_common.scss b/src/stylesheet/_common.scss
index 93e34ef..2e0e4d7 100644
--- a/src/stylesheet/_common.scss
+++ b/src/stylesheet/_common.scss
@@ -233,61 +233,6 @@ editablelabel > stack > text {
   @include entry(normal);
 }
 
-/*********
- * Links *
- *********/
-
-%link,
-link {
-  color: $link_color;
-  text-decoration: underline;
-
-  &:visited {
-    color: $link_visited_color;
-
-    *:selected & { color: mix($selected_fg_color, $link_visited_color, 60%); }
-  }
-
-  &:hover {
-    $_fg: lighten($link_color, 10%);
-    color: $_fg;
-
-    *:selected & { color: mix($selected_fg_color, $_fg, 90%); }
-  }
-
-  &:active {
-    color: $link_color;
-
-    *:selected & { color: mix($selected_fg_color, $link_color, 80%); }
-  }
-
-  &:disabled { color: transparentize(desaturate($link_color, 100%), 0.2); }
-
-  @at-root %link_selected,
-  &:selected,
-  *:selected & { color: mix($selected_fg_color, $link_color, 80%); }
-}
-
-link {
-  @include focus-ring();
-}
-
-button.link {
-  @extend %link;
-
-  &,
-  &:hover,
-  &:active,
-  &:checked {
-    @extend %undecorated_button;
-  }
-
-  > label {
-    text-decoration: underline;
-  }
-}
-
-
 /*****************
  * GtkSpinButton *
  *****************/
diff --git a/src/stylesheet/_widgets.scss b/src/stylesheet/_widgets.scss
index c0481d2..52fbeef 100644
--- a/src/stylesheet/_widgets.scss
+++ b/src/stylesheet/_widgets.scss
@@ -1,3 +1,4 @@
 @import 'widgets/buttons';
 @import 'widgets/entries';
+@import 'widgets/links';
 @import 'widgets/spinner';
diff --git a/src/stylesheet/meson.build b/src/stylesheet/meson.build
index bf07737..bc1098c 100644
--- a/src/stylesheet/meson.build
+++ b/src/stylesheet/meson.build
@@ -22,6 +22,7 @@ if not fs.exists('Adwaita-light.css')
 
       'widgets/_buttons.scss',
       'widgets/_entries.scss',
+      'widgets/_links.scss',
       'widgets/_spinner.scss',
     ])
 
diff --git a/src/stylesheet/widgets/_links.scss b/src/stylesheet/widgets/_links.scss
new file mode 100644
index 0000000..c21e1ea
--- /dev/null
+++ b/src/stylesheet/widgets/_links.scss
@@ -0,0 +1,49 @@
+%link,
+link {
+  color: $link_color;
+  text-decoration: underline;
+
+  &:visited {
+    color: $link_visited_color;
+
+    *:selected & { color: mix($selected_fg_color, $link_visited_color, 60%); }
+  }
+
+  &:hover {
+    $_fg: lighten($link_color, 10%);
+    color: $_fg;
+
+    *:selected & { color: mix($selected_fg_color, $_fg, 90%); }
+  }
+
+  &:active {
+    color: $link_color;
+
+    *:selected & { color: mix($selected_fg_color, $link_color, 80%); }
+  }
+
+  &:disabled { color: transparentize(desaturate($link_color, 100%), 0.2); }
+
+  @at-root %link_selected,
+  &:selected,
+  *:selected & { color: mix($selected_fg_color, $link_color, 80%); }
+}
+
+link {
+  @include focus-ring();
+}
+
+button.link {
+  @extend %link;
+
+  &,
+  &:hover,
+  &:active,
+  &:checked {
+    @extend %undecorated_button;
+  }
+
+  > label {
+    text-decoration: underline;
+  }
+}


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