Skip to content

Commit

Permalink
feat(HyperlinkButton): lightweight styling for hyperlinkbutton
Browse files Browse the repository at this point in the history
fix: unecessary imports

feat(HyperlinkButton): lightweight styling for hyperlinkbutton
  • Loading branch information
rajamatt committed Jul 12, 2023
1 parent 66d109c commit 20e3bb6
Show file tree
Hide file tree
Showing 2 changed files with 97 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<StaticResource x:Key="HyperlinkButtonForegroundDisabled" ResourceKey="OnSurfaceLowBrush" />

<StaticResource x:Key="HyperlinkButtonBackground" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="HyperlinkButtonBackgroundPointer" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="HyperlinkButtonBackgroundPointerOver" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="HyperlinkButtonBackgroundPressed" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="HyperlinkButtonBackgroundDisabled" ResourceKey="SystemControlTransparentBrush" />

Expand Down Expand Up @@ -44,7 +44,7 @@
<StaticResource x:Key="HyperlinkButtonForegroundDisabled" ResourceKey="OnSurfaceLowBrush" />

<StaticResource x:Key="HyperlinkButtonBackground" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="HyperlinkButtonBackgroundPointer" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="HyperlinkButtonBackgroundPointerOver" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="HyperlinkButtonBackgroundPressed" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="HyperlinkButtonBackgroundDisabled" ResourceKey="SystemControlTransparentBrush" />

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
using Microsoft.UI.Xaml.Media;
using Uno.Extensions.Markup.Internals;

namespace Uno.Themes.Markup
{
public static partial class Theme
{
public static class HyperlinkButton
{
public static class Resources
{
public static class Default
{
public static class Foreground
{
[ResourceKeyDefinition(typeof(Brush), "HyperlinkButtonForeground")]
public static ResourceValue<Brush> Default => new("HyperlinkButtonForeground", true);

[ResourceKeyDefinition(typeof(Brush), "HyperlinkButtonForegroundPointerOver")]
public static ResourceValue<Brush> PointerOver => new("HyperlinkButtonForegroundPointerOver", true);

[ResourceKeyDefinition(typeof(Brush), "HyperlinkButtonForegroundPressed")]
public static ResourceValue<Brush> Pressed => new("HyperlinkButtonForegroundPressed", true);

[ResourceKeyDefinition(typeof(Brush), "HyperlinkButtonForegroundDisabled")]
public static ResourceValue<Brush> Disabled => new("HyperlinkButtonForegroundDisabled", true);
}

public static class Background
{
[ResourceKeyDefinition(typeof(Brush), "HyperlinkButtonBackground")]
public static ResourceValue<Brush> Default => new("HyperlinkButtonBackground", true);

[ResourceKeyDefinition(typeof(Brush), "HyperlinkButtonBackgroundPointerOver")]
public static ResourceValue<Brush> PointerOver => new("HyperlinkButtonBackgroundPointerOver", true);

[ResourceKeyDefinition(typeof(Brush), "HyperlinkButtonBackgroundPressed")]
public static ResourceValue<Brush> Pressed => new("HyperlinkButtonBackgroundPressed", true);

[ResourceKeyDefinition(typeof(Brush), "HyperlinkButtonBackgroundDisabled")]
public static ResourceValue<Brush> Disabled => new("HyperlinkButtonBackgroundDisabled", true);
}

public static class BorderBrush
{
[ResourceKeyDefinition(typeof(Brush), "HyperlinkButtonBorderBrush")]
public static ResourceValue<Brush> Default => new("HyperlinkButtonBorderBrush", true);

[ResourceKeyDefinition(typeof(Brush), "HyperlinkButtonBorderBrushPointerOver")]
public static ResourceValue<Brush> PointerOver => new("HyperlinkButtonBorderBrushPointerOver", true);

[ResourceKeyDefinition(typeof(Brush), "HyperlinkButtonBorderBrushPressed")]
public static ResourceValue<Brush> Pressed => new("HyperlinkButtonBorderBrushPressed", true);

[ResourceKeyDefinition(typeof(Brush), "HyperlinkButtonBorderBrushDisabled")]
public static ResourceValue<Brush> Disabled => new("HyperlinkButtonBorderBrushDisabled", true);
}

public static class Opacity
{
[ResourceKeyDefinition(typeof(Brush), "HyperlinkButtonBackgroundOpacity")]
public static ResourceValue<Brush> Default => new("HyperlinkButtonBackgroundOpacity", true);

[ResourceKeyDefinition(typeof(Brush), "HyperlinkButtonBackgroundOpacityPointerOver")]
public static ResourceValue<Brush> PointerOver => new("HyperlinkButtonBackgroundOpacityPointerOver", true);

[ResourceKeyDefinition(typeof(Brush), "HyperlinkButtonBackgroundOpacityPressed")]
public static ResourceValue<Brush> Pressed => new("HyperlinkButtonBackgroundOpacityPressed", true);

[ResourceKeyDefinition(typeof(Brush), "HyperlinkButtonBackgroundOpacityDisabled")]
public static ResourceValue<Brush> Disabled => new("HyperlinkButtonBackgroundOpacityDisabled", true);
}

public static class Typo
{
[ResourceKeyDefinition(typeof(FontFamily), "HyperlinkButtonFontFamily")]
public static ResourceValue<FontFamily> FontFamily => new("HyperlinkButtonFontFamily", true);

[ResourceKeyDefinition(typeof(double), "HyperlinkButtonFontSize")]
public static ResourceValue<double> FontSize => new("HyperlinkButtonFontSize", true);
}
}

public static class Secondary
{
public static class Foreground
{
[ResourceKeyDefinition(typeof(Brush), "SecondaryHyperlinkButtonForeground")]
public static ResourceValue<Brush> Default => new("SecondaryHyperlinkButtonForeground", true);
}
}
}
}
}
}

0 comments on commit 20e3bb6

Please sign in to comment.