IconTrim 0.1.4
dotnet add package IconTrim --version 0.1.4
NuGet\Install-Package IconTrim -Version 0.1.4
<PackageReference Include="IconTrim" Version="0.1.4" />
<PackageVersion Include="IconTrim" Version="0.1.4" />
<PackageReference Include="IconTrim" />
paket add IconTrim --version 0.1.4
#r "nuget: IconTrim, 0.1.4"
#:package IconTrim@0.1.4
#addin nuget:?package=IconTrim&version=0.1.4
#tool nuget:?package=IconTrim&version=0.1.4
IconTrim
IconTrim scans application files for Bootstrap Icons references and generates a smaller WOFF2 font with matching CSS.
dotnet add package IconTrim
The package brings IconTrim.Core, IconTrim.BootstrapIcons, IconTrim.FontTools, and IconTrim.Hosting through NuGet dependencies. Font generation requires an external Python installation with FontTools and Brotli support. IconTrim discovers a usable interpreter automatically; set FontToolsOptions.PythonExecutable to choose one explicitly.
The package targets net8.0 as its minimum and supports .NET 8 and later applications. The solution tests and an ASP.NET Core consumer have been validated on .NET 8; a .NET 10 consumer also passed restore, build, and font generation.
using IconTrim.BootstrapIcons.DependencyInjection;
using IconTrim.Core.DependencyInjection;
using IconTrim.FontTools.DependencyInjection;
using IconTrim.Hosting.DependencyInjection;
builder.Services.AddIconTrim(options =>
{
options.BasePath = Path.GetFullPath(builder.Environment.ContentRootPath);
options.Scan.Roots.Add(".");
options.Scan.IconPrefix = "bi-";
options.Font.SourceFontPath = "wwwroot/lib/bootstrap-icons/fonts/bootstrap-icons.woff2";
options.Output.CssPath = "wwwroot/css/bootstrap-icons.subset.css";
options.Output.FontDirectory = "wwwroot/fonts";
options.Output.FontUrlPrefix = "/fonts";
options.Output.AssetPrefix = "bootstrap-icons";
})
.AddBootstrapIcons(options => options.CssPath = "wwwroot/lib/bootstrap-icons/bootstrap-icons.min.css")
.AddFontTools();
builder.Services.AddIconTrimOnStartup();
See the repository README for CLI, configuration, and incremental execution details.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- IconTrim.BootstrapIcons (>= 0.1.4)
- IconTrim.Core (>= 0.1.4)
- IconTrim.FontTools (>= 0.1.4)
- IconTrim.Hosting (>= 0.1.4)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Preserve existing CSS and WOFF2 files when generation produces identical content, including after rebuilding incremental state. Remove the generated CSS timestamp and explicitly preserve font timestamps in FontTools.