Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/release/10.0.0' into feature/b…
Browse files Browse the repository at this point in the history
…ulk-install
  • Loading branch information
valadas committed Jan 4, 2025
2 parents 98c5406 + ab80595 commit c31fd69
Show file tree
Hide file tree
Showing 95 changed files with 2,819 additions and 1,623 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/browserslist-update-db.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Update Browserslist database

on:
schedule:
- cron: '0 2 1,15 * *'

permissions:
contents: write
pull-requests: write

jobs:
update-browserslist-database:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Configure git
run: |
# Setup for commiting using built-in token. See https://github.com/actions/checkout#push-a-commit-using-the-built-in-token
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
- name: Update Browserslist database and create PR if applies
uses: c2corg/browserslist-update-action@v2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: browserslist-update
base_branch: develop
labels: 'javascript, Type: Maintenance'
117 changes: 77 additions & 40 deletions DNN Platform/DotNetNuke.Abstractions/Portals/IPortalStyles.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,205 +9,231 @@ namespace DotNetNuke.Abstractions.Portals
/// </summary>
public interface IPortalStyles
{
/// <summary>
/// Gets or sets a value indicating whether the site admins can edit the styles.
/// </summary>
bool AllowAdminEdits { get; set; }

/// <summary>
/// Gets or sets the main shade of the primary color.
/// </summary>
StyleColor ColorPrimary { get; set; }
string ColorPrimary { get; set; }

/// <summary>
/// Gets or sets the light shade of the primary color.
/// </summary>
StyleColor ColorPrimaryLight { get; set; }
string ColorPrimaryLight { get; set; }

/// <summary>
/// Gets or sets the dark shade of the primary color.
/// </summary>
StyleColor ColorPrimaryDark { get; set; }
string ColorPrimaryDark { get; set; }

/// <summary>
/// Gets or sets a color that contrasts well over the primary color shades.
/// </summary>
StyleColor ColorPrimaryContrast { get; set; }
string ColorPrimaryContrast { get; set; }

/// <summary>
/// Gets or sets the main shade of the secondary color.
/// </summary>
StyleColor ColorSecondary { get; set; }
string ColorSecondary { get; set; }

/// <summary>
/// Gets or sets the light shade of the secondary color.
/// </summary>
StyleColor ColorSecondaryLight { get; set; }
string ColorSecondaryLight { get; set; }

/// <summary>
/// Gets or sets the dark shade of the secondary color.
/// </summary>
StyleColor ColorSecondaryDark { get; set; }
string ColorSecondaryDark { get; set; }

/// <summary>
/// Gets or sets a color that contrasts well over the secondary color shades.
/// </summary>
StyleColor ColorSecondaryContrast { get; set; }
string ColorSecondaryContrast { get; set; }

/// <summary>
/// Gets or sets the main shade of the Tertiary color.
/// </summary>
StyleColor ColorTertiary { get; set; }
string ColorTertiary { get; set; }

/// <summary>
/// Gets or sets the light shade of the Tertiary color.
/// </summary>
StyleColor ColorTertiaryLight { get; set; }
string ColorTertiaryLight { get; set; }

/// <summary>
/// Gets or sets the dark shade of the Tertiary color.
/// </summary>
StyleColor ColorTertiaryDark { get; set; }
string ColorTertiaryDark { get; set; }

/// <summary>
/// Gets or sets a color that contrasts well over the Tertiary color shades.
/// </summary>
StyleColor ColorTertiaryContrast { get; set; }
string ColorTertiaryContrast { get; set; }

/// <summary>
/// Gets or sets the main shade of the Neutral color.
/// </summary>
StyleColor ColorNeutral { get; set; }
string ColorNeutral { get; set; }

/// <summary>
/// Gets or sets the light shade of the Neutral color.
/// </summary>
StyleColor ColorNeutralLight { get; set; }
string ColorNeutralLight { get; set; }

/// <summary>
/// Gets or sets the dark shade of the Neutral color.
/// </summary>
StyleColor ColorNeutralDark { get; set; }
string ColorNeutralDark { get; set; }

/// <summary>
/// Gets or sets a color that contrasts well over the Neutral color shades.
/// </summary>
StyleColor ColorNeutralContrast { get; set; }
string ColorNeutralContrast { get; set; }

/// <summary>
/// Gets or sets the main shade of the Background color.
/// </summary>
StyleColor ColorBackground { get; set; }
string ColorBackground { get; set; }

/// <summary>
/// Gets or sets the light shade of the Background color.
/// </summary>
StyleColor ColorBackgroundLight { get; set; }
string ColorBackgroundLight { get; set; }

/// <summary>
/// Gets or sets the dark shade of the Background color.
/// </summary>
StyleColor ColorBackgroundDark { get; set; }
string ColorBackgroundDark { get; set; }

/// <summary>
/// Gets or sets a color that contrasts well over the Background color shades.
/// </summary>
StyleColor ColorBackgroundContrast { get; set; }
string ColorBackgroundContrast { get; set; }

/// <summary>
/// Gets or sets the main shade of the Foreground color.
/// </summary>
StyleColor ColorForeground { get; set; }
string ColorForeground { get; set; }

/// <summary>
/// Gets or sets the light shade of the Foreground color.
/// </summary>
StyleColor ColorForegroundLight { get; set; }
string ColorForegroundLight { get; set; }

/// <summary>
/// Gets or sets the dark shade of the Foreground color.
/// </summary>
StyleColor ColorForegroundDark { get; set; }
string ColorForegroundDark { get; set; }

/// <summary>
/// Gets or sets a color that contrasts well over the Foreground color shades.
/// </summary>
StyleColor ColorForegroundContrast { get; set; }
string ColorForegroundContrast { get; set; }

/// <summary>
/// Gets or sets the main shade of the Info color.
/// </summary>
StyleColor ColorInfo { get; set; }
string ColorInfo { get; set; }

/// <summary>
/// Gets or sets the light shade of the Info color.
/// </summary>
StyleColor ColorInfoLight { get; set; }
string ColorInfoLight { get; set; }

/// <summary>
/// Gets or sets the dark shade of the Info color.
/// </summary>
StyleColor ColorInfoDark { get; set; }
string ColorInfoDark { get; set; }

/// <summary>
/// Gets or sets a color that contrasts well over the Info color shades.
/// </summary>
StyleColor ColorInfoContrast { get; set; }
string ColorInfoContrast { get; set; }

/// <summary>
/// Gets or sets the main shade of the Success color.
/// </summary>
StyleColor ColorSuccess { get; set; }
string ColorSuccess { get; set; }

/// <summary>
/// Gets or sets the light shade of the Success color.
/// </summary>
StyleColor ColorSuccessLight { get; set; }
string ColorSuccessLight { get; set; }

/// <summary>
/// Gets or sets the dark shade of the Success color.
/// </summary>
StyleColor ColorSuccessDark { get; set; }
string ColorSuccessDark { get; set; }

/// <summary>
/// Gets or sets a color that contrasts well over the Success color shades.
/// </summary>
StyleColor ColorSuccessContrast { get; set; }
string ColorSuccessContrast { get; set; }

/// <summary>
/// Gets or sets the main shade of the Warning color.
/// </summary>
StyleColor ColorWarning { get; set; }
string ColorWarning { get; set; }

/// <summary>
/// Gets or sets the light shade of the Warning color.
/// </summary>
StyleColor ColorWarningLight { get; set; }
string ColorWarningLight { get; set; }

/// <summary>
/// Gets or sets the dark shade of the Warning color.
/// </summary>
StyleColor ColorWarningDark { get; set; }
string ColorWarningDark { get; set; }

/// <summary>
/// Gets or sets a color that contrasts well over the Warning color shades.
/// </summary>
StyleColor ColorWarningContrast { get; set; }
string ColorWarningContrast { get; set; }

/// <summary>
/// Gets or sets the main shade of the Danger color.
/// </summary>
StyleColor ColorDanger { get; set; }
string ColorDanger { get; set; }

/// <summary>
/// Gets or sets the light shade of the Danger color.
/// </summary>
StyleColor ColorDangerLight { get; set; }
string ColorDangerLight { get; set; }

/// <summary>
/// Gets or sets the dark shade of the Danger color.
/// </summary>
StyleColor ColorDangerDark { get; set; }
string ColorDangerDark { get; set; }

/// <summary>
/// Gets or sets a color that contrasts well over the Danger color shades.
/// </summary>
StyleColor ColorDangerContrast { get; set; }
string ColorDangerContrast { get; set; }

/// <summary>
/// Gets or sets the color of the surface.
/// A surface is an area that is overlaid over the main background (menus, popovers, etc).
/// </summary>
string ColorSurface { get; set; }

/// <summary>
/// Gets or sets the light variation of surface color.
/// </summary>
string ColorSurfaceLight { get; set; }

/// <summary>
/// Gets or sets the dark variation of surface color.
/// </summary>
string ColorSurfaceDark { get; set; }

/// <summary>
/// Gets or sets a color that contrasts well over the surface color.
/// </summary>
string ColorSurfaceContrast { get; set; }

/// <summary>
/// Gets or sets the controls border radius in pixels.
Expand All @@ -223,5 +249,16 @@ public interface IPortalStyles
/// Gets or sets the base font size in pixels.
/// </summary>
double BaseFontSize { get; set; }

/// <summary>
/// Gets or sets the color variation opacity.
/// This can be used to define how opaque a contrasting color should look over another.
/// </summary>
double VariationOpacity { get; set; }

/// <summary>
/// Gets the name of the css file.
/// </summary>
string FileName { get; }
}
}
39 changes: 2 additions & 37 deletions DNN Platform/DotNetNuke.Abstractions/Portals/StyleColor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public StyleColor(string hexValue)
{
AssertIsValidCssColor(hexValue);

this.HexValue = ExpandColor(hexValue);
this.HexValue = hexValue;
this.red = byte.Parse(this.HexValue.Substring(0, 2), System.Globalization.NumberStyles.HexNumber);
this.green = byte.Parse(this.HexValue.Substring(2, 2), System.Globalization.NumberStyles.HexNumber);
this.blue = byte.Parse(this.HexValue.Substring(4, 2), System.Globalization.NumberStyles.HexNumber);
Expand Down Expand Up @@ -88,45 +88,10 @@ public string HexValue
set
{
AssertIsValidCssColor(value);
this.hex = ExpandColor(value);
this.hex = value;
}
}

/// <summary>
/// Gets a minified hexadecimal value for the color.
/// </summary>
/// <example>If the color is 0088FF, it should return 08F.</example>
public string MinifiedHex
{
get
{
if (
this.hex[0] == this.hex[1] &&
this.hex[2] == this.hex[3] &&
this.hex[4] == this.hex[5])
{
return $"{this.hex[0]}{this.hex[2]}{this.hex[4]}";
}

return this.hex;
}
}

private static string ExpandColor(string hexValue)
{
if (hexValue.Length == 6)
{
return hexValue.ToUpperInvariant();
}

string value;
var r = hexValue[0];
var g = hexValue[1];
var b = hexValue[2];
value = string.Concat(r, r, g, g, b, b);
return value.ToUpperInvariant();
}

private static void AssertIsValidCssColor(string hexValue)
{
if (string.IsNullOrWhiteSpace(hexValue))
Expand Down
6 changes: 0 additions & 6 deletions DNN Platform/Library/Common/Utilities/DataCache.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,6 @@ public class DataCache
/// <summary> The portal styles cache key.</summary>
public const string PortalStylesCacheKey = "Dnn_Css_Custom_Properties_{0}";

/// <summary> The portal styles cache priority.</summary>
public const CacheItemPriority PortalStylesCachePriority = CacheItemPriority.High;

/// <summary>The portal styles cache time out.</summary>
public const int PortalStylesCacheTimeOut = 20;

// Tab cache keys
public const string TabCacheKey = "Tab_Tabs{0}";
public const string TabSettingsCacheKey = "TabSettings{0}";
Expand Down
Loading

0 comments on commit c31fd69

Please sign in to comment.