.NET Framework Style Guide

Ensuring consistency and clarity in .NET Framework documentation and UI elements.

Core Principles

The .NET Framework style guide is built upon these fundamental principles:

Typography

Headings

H1: Main Document Title

H2: Section Header

H3: Subsection Header

Use semantic HTML tags for headings. Font: 'Segoe UI', sans-serif.

Body Text

Standard paragraph text. Use clear and concise language. Maintain adequate line spacing for readability.

This is an example of a paragraph. It explains concepts and provides details. Keep sentences and paragraphs focused on a single idea.

Code Snippets

Use the <code> tag for inline code and the <pre><code> block for multi-line code.


public class Greeter
{
    public void SayHello(string name)
    {
        Console.WriteLine($"Hello, {name}!");
    }
}
                

Code should be formatted with proper indentation and syntax highlighting (if implemented).

Links

Links should be clearly identifiable and use descriptive text. Standard link color is #0078d4.

This is a primary link. On hover, it turns to #d1343c and underlines.

Layout and Structure

Page Structure

Each page should follow a consistent structure:

  • Header with branding and navigation.
  • Main content area.
  • Footer with copyright and links.

Content Blocks

Use distinct blocks for different types of content, such as informational sections, examples, and warnings.

Information Block

This is an informational block. Use it to highlight important details or provide context.

Warning Block

This is a warning block. Use it to alert users to potential issues or deprecated features.

Tabs

Use tabs to organize related content without overwhelming the user.

Tab 1
Tab 2
Tab 3

Content for Tab 1

This is the content displayed when Tab 1 is active. It might contain explanations, code examples, or other relevant information.

<div id="tab1" class="tab-content active">...</div>

Content for Tab 2

This section demonstrates the second tab's content. It's a great place for alternative examples or related documentation.

Content for Tab 3

Finally, the content for the third tab. Tabs help keep complex pages organized and improve user experience.

UI Elements

Buttons

Buttons should be clear and actionable. Use primary and secondary styles.

Link as Button

Forms

Input fields should be clearly labeled and have sufficient spacing.