true-perfect-code
Version: 1.1.69

P11 Fontdesign

The components P11FontSize, P11FontFamily and P11FontWeight provide users with an easily accessible way to customize the basic Bootstrap font (sizes, weight and family) of the entire application. It uses the injected IThemeService to dynamically update the root CSS Bootstrap variables or font size properties of specific Bootstrap classes and ensure that all components based on rem units or font properties are correctly scaled or adjusted.
This components are best used with the Two-Way-Binding feature (@bind-Value), which automatically synchronizes the component's internal state with the parent component's P11FontSizeModel variable.

How to Use

P11FontSize Example:


<P11FontSize @bind-Value="_fontSizeModel" OffsetFontSize="0.1" />

@code {
    private P11FontSizeModel _fontSizeModel = new P11FontSizeModel();
}

P11FontFamily Example:


<P11FontFamily @bind-Value="_fontFamilyModel"
               AvailableFontFamilies="_availableFontFamilies" />

@code {
    private FontFamilyModel _fontFamilyModel = new FontFamilyModel();
    private List<FontFamilyItem> _availableFontFamilies = GetFontList();
}

P11FontWeight Example:


<P11FontWeight @bind-Value="_myLocalFontWeightModel" /> />

@code {
    private FontWeightModel _myLocalFontWeightModel = new();
}

P11FontSpacing Example:


<P11FontSpacing @bind-Value="_currentSpacingValue" /> />

@code {
    private double _currentSpacingValue = 0.0;
}

P11FontLineheight Example:


<P11FontLineheight @bind-Value="_currentLineheightValue" /> />

@code {
    private double _currentLineheightValue = 1.5;
}

That's it ✔️ Simply enclose your markup code and select the desired font size, weight or type.

For detailed API parameters and live examples of the **Fontsize**, jump to the dedicated page: Go to Font Size Documentation
For detailed API parameters and live examples of the **Fontfamily**, jump to the dedicated page: Go to Font Family Documentation
For detailed API parameters and live examples of the **FontWeight**, jump to the dedicated page: Go to Font Weight Documentation
For detailed API parameters and live examples of the **FontSpacing**, jump to the dedicated page: Go to Font Spacing Documentation
For detailed API parameters and live examples of the **FontLineheight**, jump to the dedicated page: Go to Font Lineheight Documentation

Application examples and current font settings

Font Size Configuration (P11FontSize)

Current step size in rem: 0.05
Current layout: Horizontal
Minimum 1rem size: 0.80 rem. (Default: 0.8)
Maximum 1rem size: 1.50 rem. (Default: 1.5)

P11FontSize Live Component

Important: Clicking the buttons immediately updates the CSS variables via the injected theme service. This allows you to see the effects directly in the DOM of the entire page.

Available REM Properties and Current Values

Font (REM Property) Current Size (Calculated rem)
0.75rem 0.750rem
0.875rem 0.875rem
0.9rem 0.900rem
1rem (Base Size) 1.000rem
1.1rem 1.100rem
1.25rem 1.250rem
1.5rem 1.500rem
1.75rem 1.750rem
2rem 2.000rem
2.5rem 2.500rem

These values are automatically updated when the font size adjuster above is used.

Font Family Configuration (P11FontFamily)

Current selected font family CSS value: Default (System)


P11FontFamily Live Component

Note: The P11FontFamily component is mocked here. It should render a dropdown or similar control based on the provided list.
Component Configuration
Current layout: Horizontal

P11FontWeight Live Component

Important: Clicking the buttons immediately updates the CSS variable '--p11-font-weight' (and '--bs-body-font-weight') via the theme service. This allows you to see the effects directly across the entire page.

Available Font-Weight Properties and Current Values

Weight Level Current Value CSS Class
Thin100.fw-thin
Extra Light200.fw-extralight
Light300.fw-light
Normal400.fw-normal / body
Medium500.fw-medium
Semi Bold600.fw-semibold
Bold700.fw-bold
Extra Bold800.fw-extrabold
Black900.fw-black

These values are automatically updated when the font weight adjuster above is used.

Font Spacing Configuration (P11FontSpacing)

Current selected font spacing CSS value: Default (System)


P11FontSpacing Live Component

Current value (EM): 0.00em
Component Configuration
Current layout: Horizontal

P11FontLineheight Live Component

Current value ( no units): 1.50
An unhandled error has occurred. Reload 🗙