-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #128 from Blazorade/fix/112-shadow
ShadowSize enum -> Shadow struct
- Loading branch information
Showing
7 changed files
with
122 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 18 additions & 5 deletions
23
Blazorade.Bootstrap.Components/Blazorade.Bootstrap.Components.xml
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
|
||
namespace Blazorade.Bootstrap.Components.Utilities | ||
{ | ||
/// <summary> | ||
/// Defines different shadow sizes for components. | ||
/// </summary> | ||
public struct Shadow | ||
{ | ||
|
||
internal const string NoneValue = ClassNames.Shadows.None; | ||
|
||
internal const string SmallValue = ClassNames.Shadows.Small; | ||
|
||
internal const string RegularValue = ClassNames.Shadows.Regular; | ||
|
||
internal const string LargeValue = ClassNames.Shadows.Large; | ||
|
||
|
||
|
||
/// <summary> | ||
/// No shadow. Default. | ||
/// </summary> | ||
public static Shadow None | ||
{ | ||
get { return new Shadow(NoneValue); } | ||
} | ||
|
||
/// <summary> | ||
/// A small shadow. | ||
/// </summary> | ||
public static Shadow Small | ||
{ | ||
get { return new Shadow(SmallValue); } | ||
} | ||
|
||
/// <summary> | ||
/// Regular shadow. | ||
/// </summary> | ||
public static Shadow Regular | ||
{ | ||
get { return new Shadow(RegularValue); } | ||
} | ||
|
||
/// <summary> | ||
/// Large shadow. | ||
/// </summary> | ||
public static Shadow Large | ||
{ | ||
get { return new Shadow(LargeValue); } | ||
} | ||
|
||
|
||
internal Shadow(string s) | ||
{ | ||
this.Value = s; | ||
} | ||
|
||
|
||
/// <summary> | ||
/// Converts the given string to <see cref="Shadow"/>. | ||
/// </summary> | ||
public static implicit operator Shadow(string s) | ||
{ | ||
switch ($"{s}".ToLower()) | ||
{ | ||
case "sm": | ||
case "small": | ||
return Shadow.Small; | ||
|
||
case "r": | ||
case "reg": | ||
case "regular": | ||
return Shadow.Regular; | ||
|
||
case "lg": | ||
case "l": | ||
case "large": | ||
return Shadow.Large; | ||
|
||
default: | ||
return Shadow.None; | ||
} | ||
} | ||
|
||
/// <summary> | ||
/// The value. | ||
/// </summary> | ||
/// <remarks> | ||
/// The value equals the class name to add to an element for different sizes of shadows. | ||
/// </remarks> | ||
public string Value { get; private set; } | ||
|
||
} | ||
|
||
} |
This file was deleted.
Oops, something went wrong.