[libadwaita/wip/exalm/tabs: 5/6] Add styles for AdwTab*
- From: Alexander Mikhaylenko <alexm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libadwaita/wip/exalm/tabs: 5/6] Add styles for AdwTab*
- Date: Mon, 10 May 2021 15:13:10 +0000 (UTC)
commit f90ba3e6b4e370dd150b2c4a8a21e747958a41a4
Author: Alexander Mikhaylenko <alexm gnome org>
Date: Sat Apr 17 16:46:07 2021 +0500
Add styles for AdwTab*
src/stylesheet/_widgets.scss | 1 +
src/stylesheet/meson.build | 1 +
src/stylesheet/widgets/_tab-view.scss | 177 ++++++++++++++++++++++++++++++++++
3 files changed, 179 insertions(+)
---
diff --git a/src/stylesheet/_widgets.scss b/src/stylesheet/_widgets.scss
index 6ed9628..315dc72 100644
--- a/src/stylesheet/_widgets.scss
+++ b/src/stylesheet/_widgets.scss
@@ -28,6 +28,7 @@
@import 'widgets/spinner';
@import 'widgets/spin-button';
@import 'widgets/switch';
+@import 'widgets/tab-view';
@import 'widgets/text-selection';
@import 'widgets/toolbars';
@import 'widgets/tooltip';
diff --git a/src/stylesheet/meson.build b/src/stylesheet/meson.build
index a7ec73c..932172a 100644
--- a/src/stylesheet/meson.build
+++ b/src/stylesheet/meson.build
@@ -50,6 +50,7 @@ if not fs.exists('Adwaita-light.css')
'widgets/_spinner.scss',
'widgets/_spin-button.scss',
'widgets/_switch.scss',
+ 'widgets/_tab-view.scss',
'widgets/_text-selection.scss',
'widgets/_toolbars.scss',
'widgets/_tooltip.scss',
diff --git a/src/stylesheet/widgets/_tab-view.scss b/src/stylesheet/widgets/_tab-view.scss
new file mode 100644
index 0000000..e1489fb
--- /dev/null
+++ b/src/stylesheet/widgets/_tab-view.scss
@@ -0,0 +1,177 @@
+$tab_bg: darken($bg_color, if($variant == 'dark', 6%, 12%));
+
+@mixin undershoot-gradient($dir) {
+ @if $variant == 'dark' {
+ background: linear-gradient(to #{$dir},
+ transparentize(black, .6),
+ transparentize(black, 1) 20px);
+ }
+ @else {
+ background: linear-gradient(to #{$dir},
+ transparentize(black, .93),
+ transparentize(black, 1) 20px);
+ }
+}
+
+@mixin need-attention-gradient($dir) {
+ background: linear-gradient(to #{$dir},
+ transparentize($selected_bg_color, .3),
+ transparentize($selected_bg_color, .5) 1px,
+ transparentize($selected_bg_color, 1) 20px);
+}
+
+tabbar {
+ .box {
+ min-height: 38px;
+ background: darken($tab_bg, 3%);
+ border-bottom: 1px solid $alt_borders_color;
+ }
+
+ scrolledwindow.pinned {
+ undershoot {
+ border: 0 solid $alt_borders_color;
+ }
+
+ &:dir(rtl) undershoot.left {
+ border-left-width: 1px;
+ }
+
+ &:dir(ltr) undershoot.right {
+ border-right-width: 1px;
+ }
+
+ tabbox {
+ &:dir(ltr) {
+ box-shadow: inset -1px 0 $alt_borders_color;
+ }
+
+ &:dir(rtl) {
+ box-shadow: inset 1px 0 $alt_borders_color;
+ }
+ }
+ }
+
+ undershoot {
+ transition: background 150ms ease-in-out;
+
+ &.left {
+ @include undershoot-gradient("right");
+ }
+
+ &.right {
+ @include undershoot-gradient("left");
+ }
+ }
+
+ .needs-attention-left undershoot.left {
+ @include need-attention-gradient("right");
+ }
+
+ .needs-attention-right undershoot.right {
+ @include need-attention-gradient("left");
+ }
+
+ tab {
+ border-style: solid;
+ border-color: $alt_borders_color;
+ border-width: 0 1px 0 1px;
+ transition: background 150ms ease-in-out, $focus_transition;
+ background-color: $tab_bg;
+
+ @include focus-ring();
+
+ &:checked {
+ background-color: lighten($tab_bg, 6%);
+
+ &:hover {
+ background-color: lighten($tab_bg, 9%);
+ }
+ }
+
+ &:hover {
+ background-color: lighten($tab_bg, 3%);
+ }
+ }
+
+ .start-action,
+ .end-action {
+ background: $tab_bg;
+ border-color: $alt_borders_color;
+ border-style: solid;
+ transition: background 150ms ease-in-out;
+
+ button {
+ border: none;
+ border-radius: 0;
+ }
+ }
+
+ .start-action:dir(ltr),
+ .end-action:dir(rtl) {
+ border-right-width: 1px;
+ }
+
+ .start-action:dir(rtl),
+ .end-action:dir(ltr) {
+ border-left-width: 1px;
+ }
+}
+
+dnd tab {
+ min-height: 26px;
+ background-color: lighten($tab_bg, 9%);
+
+ $_wm_border: if($variant=='light', transparentize(black, 0.77), transparentize(black, 0.25));
+
+ box-shadow: 0 3px 9px 1px transparentize(black, 0.75),
+ 0 0 0 1px $_wm_border;
+
+ @if $variant == 'dark' {
+ $_wm_outline: if($contrast=='high', transparentize(white, .7), transparentize(white, .9));
+
+ outline: 1px solid $_wm_outline;
+ outline-offset: -1px;
+ }
+
+ margin: 25px;
+}
+
+tabbar,
+dnd {
+ tab {
+ padding: 6px;
+
+ &.needs-attention {
+ background-image:
+ radial-gradient(ellipse at bottom,
+ transparentize(white, .2),
+ transparentize($selected_bg_color, .8) 15%,
+ transparentize($selected_bg_color, 1) 15%);
+ }
+
+ button.image-button {
+ padding: 0;
+ margin: 0;
+ min-width: 24px;
+ min-height: 24px;
+ border-radius: 99px;
+
+ border: none;
+ box-shadow: none;
+ background: none;
+
+ &:hover {
+ background: gtkalpha($fg_color, .15);
+ }
+
+ &:active {
+ background: gtkalpha(black, .2);
+ }
+ }
+ }
+}
+
+tabview:drop(active),
+tabbox:drop(active) {
+ box-shadow: none;
+}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]