# Duplicate Property Detection

Duplicate property detection prevents overrides from happening within the same ruleset. Overrides of this nature are generally more accidental than intensional, for example:

```jsx
<section className="hero">
  background: ivory;
  display: flex;
  background: coral;
</section>
```

In the example above the `background` property has been defined twice within the same ruleset. A compile time error catches the duplicate property and throws the following:

![](https://2035066516-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LSaW3lW0D0P6RRGeAif%2F-LSa_Sc70KAX92GRTBtO%2F-LSa_TAPdAS5VuJqX9oO%2FDuplicateCSSPropertyTwo.png?generation=1543614359528745\&alt=media)

It should be noted that if a property *partially overrides* another property in the *same ruleset* a partial override error is thrown:

```jsx
<h1 className="heading">
  margin: 0px;
  color: dimgray;
  margin-bottom: 10px;
</h1>
```

In the example above both `margin` and `margin-bottom` have been used. Since the longhand property `margin-bottom` overrides the shorthand property `margin` a partial override error is thrown:

![](https://2035066516-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LSaW3lW0D0P6RRGeAif%2F-LSa_Sc70KAX92GRTBtO%2F-LSa_TAS18jznEx47sqS%2FPartialOverrideFoundTwo.png?generation=1543614359842087\&alt=media)

More information on partial overrides can be [found here](https://callum-hart.gitbook.io/immutable-styles/advancedconcepts/partialoverrides).


---

# 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://callum-hart.gitbook.io/immutable-styles/advancedconcepts/duplicatepropertydetection.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.
