From 165dbba540585630f000578bfec7479b56fa5b7f Mon Sep 17 00:00:00 2001 From: capdiem Date: Fri, 4 Aug 2023 15:47:00 +0800 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=20refactor:=20Rename=20the=20method?= =?UTF-8?q?=20that=20adds=20the=20native=20CSS=20classes=20(#5)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * ♻ refactor: Rename the method that adds the native CSS classes * 🔖 chore: update package version --- BemIt/Abstract/IBem.cs | 11 ++++++++++- BemIt/BemBase.cs | 4 +++- BemIt/BemIt.csproj | 2 +- BemIt/Modifier.cs | 2 +- 4 files changed, 15 insertions(+), 4 deletions(-) diff --git a/BemIt/Abstract/IBem.cs b/BemIt/Abstract/IBem.cs index 28ce323..85a4c4e 100644 --- a/BemIt/Abstract/IBem.cs +++ b/BemIt/Abstract/IBem.cs @@ -2,7 +2,16 @@ public interface IBem { - IBem Add(params string?[] classNames); + /// + /// Adds original class names + /// + /// a single or a list of class names + /// + IBem AddClass(params string?[] classNames); + /// + /// Builds the css class + /// + /// string Build(); } diff --git a/BemIt/BemBase.cs b/BemIt/BemBase.cs index c67e3ca..603ebcd 100644 --- a/BemIt/BemBase.cs +++ b/BemIt/BemBase.cs @@ -6,12 +6,14 @@ public class BemBase : IBem { protected List 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(); diff --git a/BemIt/BemIt.csproj b/BemIt/BemIt.csproj index 62b4b26..1cee438 100644 --- a/BemIt/BemIt.csproj +++ b/BemIt/BemIt.csproj @@ -7,7 +7,7 @@ BemIt https://github.com/capdiem/BemIt capdiem - 1.1.0 + 1.1.1 https://github.com/capdiem/BemIt blazor;css;bem;block;element;modifier; True diff --git a/BemIt/Modifier.cs b/BemIt/Modifier.cs index bfc164b..1741e9e 100644 --- a/BemIt/Modifier.cs +++ b/BemIt/Modifier.cs @@ -195,7 +195,7 @@ public static string FormatEnum(Enum @enum, string? inputName = null) } /// - /// Builds to the css class from a modifier + /// Builds the css class from a modifier /// /// public override string Build()