Skip to content

Contributing

David edited this page Jun 25, 2022 · 29 revisions

Contributing to Blazorise

We welcome contributions and any suggestions or feature requests you might have. Contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. This will be signed once you submit a PullRequest on our repository. For details about our CLA, please visit https://gist.github.com/stsrki/abfa5ce0f4a5cf1e6ac67b92f8eb5d63

Getting Started

Please visit https://github.com/Megabit/Blazorise/blob/master/CONTRIBUTING.md to learn how to setup the required steps to contribute.

Conventions && Guidelines

To reduce code complexity and improve readability we ask you that you follow our repository conventions and guidelines when submitting a pull request.

Formatting

If possible, adhere to the provided .editorconfig formatting rules.

Coding conventions

Blazor

When working with blazor components, it is prefered to separate the component into two files

  • TextEdit.razor (Mostly markup concerns and rendering/styling logic)
  • TextEdit.razor.cs (All the members, parameters and logic that make the component work)

We keep the main sections of our components separated by regions, please adhere to the following class template:

public partial class MyComponent : BaseComponent
{
  #region Members

  #endregion
  #region Constructors

  #endregion
  #region Methods

  #endregion
  #region Properties

  #endregion
}
Blazorise styling:

For component css prefer: b-{component} instead of b-is-{component}

Naming

  • Private fields : Camel Case : "exampleField"
  • Methods : Pascal Case : "ExampleMethod"
  • Properties : Pascal Case : "ExampleField"

Coding

  • Prefer is null and is not null over == null and != null
  • Prefer prefixless booleans for regular properties, example: Loading over IsLoading
    • Exception is when you provide a property getter, then it's good practice to prefix it, example : IsLoading => Options?.Loading ?? Loading ?? false;
Clone this wiki locally