Skip to content

Commit

Permalink
♻ refactor: Rename the method that adds the native CSS classes (#5)
Browse files Browse the repository at this point in the history
* ♻ refactor: Rename the method that adds the native CSS classes

* 🔖 chore: update package version
  • Loading branch information
capdiem authored Aug 4, 2023
1 parent 742c849 commit 165dbba
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
11 changes: 10 additions & 1 deletion BemIt/Abstract/IBem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,16 @@

public interface IBem
{
IBem Add(params string?[] classNames);
/// <summary>
/// Adds original class names
/// </summary>
/// <param name="classNames">a single or a list of class names</param>
/// <returns></returns>
IBem AddClass(params string?[] classNames);

/// <summary>
/// Builds the css class
/// </summary>
/// <returns></returns>
string Build();
}
4 changes: 3 additions & 1 deletion BemIt/BemBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@ public class BemBase : IBem
{
protected List<string?> ClassNames { get; } = new();

public IBem Add(params string?[] classNames)
// inherits
public IBem AddClass(params string?[] classNames)
{
ClassNames.AddRange(classNames);
return this;
}

// inherits
public virtual string Build()
{
return string.Join(" ", ClassNames).Trim();
Expand Down
2 changes: 1 addition & 1 deletion BemIt/BemIt.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<PackageId>BemIt</PackageId>
<PackageProjectUrl>https://github.com/capdiem/BemIt</PackageProjectUrl>
<Authors>capdiem</Authors>
<Version>1.1.0</Version>
<Version>1.1.1</Version>
<RepositoryUrl>https://github.com/capdiem/BemIt</RepositoryUrl>
<PackageTags>blazor;css;bem;block;element;modifier;</PackageTags>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
Expand Down
2 changes: 1 addition & 1 deletion BemIt/Modifier.cs
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ public static string FormatEnum(Enum @enum, string? inputName = null)
}

/// <summary>
/// Builds to the css class from a modifier
/// Builds the css class from a modifier
/// </summary>
/// <returns></returns>
public override string Build()
Expand Down

0 comments on commit 165dbba

Please sign in to comment.