# Extending Resources

Acss's resources (AcssResource) support extensions. Currently we have some common resource types built-in, and you can also define your own resource types.

## Built-in resource types

1. Brush
2. Color
3. Double
4. Int
5. LinearBrush
6. Thickness
7. Transition
8. BoxShadows

{% hint style="success" %}
More built-in resource types will be added later in the programme.
{% endhint %}

## Custom Resource Types

Acss's resources all inherit from the abstract class AcssResourceBaseAndFac, defined as follows:

```csharp
public abstract class AcssResourceBaseAndFac<T> : AcssResource, IResourceFactory 
    where T : AcssResource, new()
```

You can inherit this class to extend your own resource types, for example in the following code we extend the resource type that defines Thickness.&#x20;

The aliases for this type are "Thickness", "Thick", "StrokeThickness", " Margin", "Padding". Any of these aliases will be resolved to a Thickness resource in Acss code.

{% hint style="warning" %}
Note that aliases are <mark style="color:red;">**not case insensitive**</mark>. thick and thick refer to the same resource type, Thickness.
{% endhint %}

```csharp
[ResourceType(nameof(Thickness))]
[ResourceType("Thick")]
[ResourceType("StrokeThickness")]
[ResourceType("Margin")]
[ResourceType("Padding")]
internal class ThicknessResource : AcssResourceBaseAndFac<ThicknessResource>
{
    protected override object? BuildValue(IAcssContext context, string valueString)
    {
        return valueString.TryParseThickness();
    }
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.en.avalonia.css.nlnet.net/documentation/zhu-ti-bang-zhu/ru-he-shi-yong-acss/kuo-zhan-zi-yuan.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
