Skip to content

Commit

Permalink
fix: fixed color scheme in light theme (#69)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lytvynenko-Danylo authored Nov 17, 2020
1 parent e9415fb commit 344d1bf
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
9 changes: 6 additions & 3 deletions Editor/UIToolkit/Controls/ButtonStrip/ButtonStrip.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System.Linq;
using JetBrains.Annotations;
using StansAssets.Foundation.Editor;
using UnityEditor;
using UnityEngine;
using UnityEngine.UIElements;

Expand Down Expand Up @@ -35,7 +36,8 @@ public sealed class ButtonStrip : VisualElement
const string k_ButtonMidClassName = k_ButtonClassName + "--mid";
const string k_ButtonRightClassName = k_ButtonClassName + "--right";
const string k_ButtonIconClassName = UssClassName + "__button-icon";
const string k_ButtonActiveClassName = k_ButtonClassName + "--active";
const string k_ButtonActiveClassNameDark = k_ButtonClassName + "--active-dark";
const string k_ButtonActiveClassNameLight = k_ButtonClassName + "--active-light";

readonly List<string> m_Choices = new List<string>();
readonly List<string> m_Labels = new List<string>();
Expand Down Expand Up @@ -209,10 +211,11 @@ void ToggleButtonStates(Button button)
{
foreach (var btn in m_Buttons)
{
btn.RemoveFromClassList(k_ButtonActiveClassName);
btn.RemoveFromClassList(k_ButtonActiveClassNameDark);
btn.RemoveFromClassList(k_ButtonActiveClassNameLight);
}

button.AddToClassList(k_ButtonActiveClassName);
button.AddToClassList(EditorGUIUtility.isProSkin ? k_ButtonActiveClassNameDark : k_ButtonActiveClassNameLight);
}
}
}
Expand Down
6 changes: 5 additions & 1 deletion Editor/UIToolkit/Controls/ButtonStrip/ButtonStrip.uss
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,14 @@
padding-top: 2px;
}

.stansassets-button-strip__button--active {
.stansassets-button-strip__button--active-dark {
color: aqua;
}

.stansassets-button-strip__button--active-light {
color: #006f6f;
}

.stansassets-button-strip__button--left {
padding-left: 4px;
margin-right: 0;
Expand Down
1 change: 1 addition & 0 deletions Editor/UIToolkit/Controls/Hyperlink/Hyperlink.uss
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
.stansassets-hyperlink-block:hover Label,
.stansassets-hyperlink-block:hover VisualElement {
-unity-background-image-tint-color: cornflowerblue;
border-color: cornflowerblue;
color: cornflowerblue;
cursor: link;
}

0 comments on commit 344d1bf

Please sign in to comment.