Skip to content

Latest commit

 

History

History
30 lines (27 loc) · 2.27 KB

CONTRIBUTING.md

File metadata and controls

30 lines (27 loc) · 2.27 KB

Information and Guidelines for Contributors

Thank you for contributing to HAVIT Blazor and making it even better. We are happy about every contribution! Issues, fixes, enahncements, new components...

Coding Standards

Naming Guidelines

  • Preserve original Bootstrap naming whenever possible (adjust to comply with .NET coding standards).
  • Follow existing Blazor naming whenever possible.
  • Prefix all event parameters with On, e.g. OnClosed, OnShown, OnFileUploaded (except XyChanged callbacks).
  • Suffix all RenderFragment-parameters with Template (except very specific cases such as HxGrid.Columns), e.g. HeaderTemplate, ItemTemplate, FooterTemplate.
  • Suffix all Func-parameters returning a projection with Selector, e.g. TextSelector, CssClassSelector, ValueSelector. See HxSelect for samples.

Design Guidelines

  • Prefer ease of user over complex functionality.
  • Allow interception of the events in derived components by using the virtual InvokeOnEventNameAsync() methods
[Parameter] public EventCallback OnClosed { get; set; }
protected virtual Task InvokeOnClosedAsync() => OnClosed.InvokeAsync();
  • Allow setting application-wide defaults by using the Defaults static property. Allow extension of the defaults in derived components by using the GetDefaults() virtual method.
public static ComponentNameSettings Defaults { get; set; } = new();
protected virtual ComponentNameSettings GetDefaults() => Defaults;
  • Use CSS variables whenever possible. Prefer existing variables over creating new ones (use derived values if possible).
  • Provide /// <summary> comments (extracted to API documentation).
  • Create simple demos presenting individual features. Bootstrap docs might be inspiration for you.