# Change Image-Occlusion-Box colour in Closet Add-On

**URL:** <https://forums.ankiweb.net/t/change-image-occlusion-box-colour-in-closet-add-on/41671>\
**Category:** Card Design\
**Created:** [February 26, 2024, 7:26pm UTC](https://forums.ankiweb.net/t/change-image-occlusion-box-colour-in-closet-add-on/41671 "2024-02-26T19:26:50Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lin2061](https://avatars.discourse-cdn.com/v4/letter/l/aca169/32.png) [@Lin2061](https://forums.ankiweb.net/u/Lin2061)\
**Post date:** [February 26, 2024, 7:26pm UTC](https://forums.ankiweb.net/t/change-image-occlusion-box-colour-in-closet-add-on/41671/1 "2024-02-26T19:26:50Z")

</div>

Hello!  
I use the Closet Add-On for my Image Occlusion Cards so I can use the feature which let’s me incrementally reveal the boxes on the card.  
Now I’d really like to change the colour of the Image-Occlusion-Boxes - does anybody know how? I’ve tried to implement a few things in HTML or CSS using ChatGPT, but I don’t know coding so I’m just stepping in the dark at this point.  
Would love some help!

---

<div class="post-metadata">

**Author:** ![philippifland](https://avatars.discourse-cdn.com/v4/letter/p/c0e974/32.png) [@philippifland](https://forums.ankiweb.net/u/philippifland)\
**Post date:** [February 27, 2024, 10:42am UTC](https://forums.ankiweb.net/t/change-image-occlusion-box-colour-in-closet-add-on/41671/2 "2024-02-27T10:42:27Z")

</div>

Hey!  
You can overwrite the color values defined in the extension source code (search for the repository hgiesel/closet on github to find it).  
In your case, the color values are defined in the file `/workspaces/closet/style/_rect.scss`, containing the following CSS:

```auto
@use "utils";

@mixin rect {
  .closet-rect__rect {
    fill: moccasin;
    stroke: olive;

    .is-active & {
      fill: salmon;
      stroke: yellow;
    }

    .is-back.is-active & {
      fill: transparent;
      stroke: transparent;
    }
  }

  .closet-rect__ellipsis {
    fill: transparent;
    stroke: transparent;
  }

  .closet-rect__label {
    stroke: black;
    stroke-width: 0.5;
  }
}

```

To overwrite these values, you can add the selector `.closet-rect__rect` to your own CSS and define some alternative colors like this:

```auto
  .closet-rect__rect {
    fill: blue;
    stroke: red;

    .is-active & {
      fill: transparent;
      stroke: black;
    }

    .is-back.is-active & {
      fill: transparent;
      stroke: yellow;
    }
  }

```

---

<div class="post-metadata">

**Author:** ![abdo](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/abdo/32/654_2.png) [@abdo](https://forums.ankiweb.net/u/abdo)\
**Post date:** [February 27, 2024, 12:01pm UTC](https://forums.ankiweb.net/t/change-image-occlusion-box-colour-in-closet-add-on/41671/3 "2024-02-27T12:01:39Z")

</div>

> [@philippifland](#):
>
> In your case, the color values are defined in the file `/workspaces/closet/style/_rect.scss`,

It’s easier to modify web/closet.css in the installed add-on’s folder, as that doesn’t require rebuilding the add-on.

---

<div class="post-metadata">

**Author:** ![philippifland](https://avatars.discourse-cdn.com/v4/letter/p/c0e974/32.png) [@philippifland](https://forums.ankiweb.net/u/philippifland)\
**Post date:** [February 27, 2024, 12:19pm UTC](https://forums.ankiweb.net/t/change-image-occlusion-box-colour-in-closet-add-on/41671/4 "2024-02-27T12:19:48Z")

</div>

Yes, that’s what I meant with the second part of my answer.  
Just wanted to clarify how I got there.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/1X/8f1279ababc5879d54e4838989f606cfe55af8c7.jpeg) [@system](https://forums.ankiweb.net/u/system)\
**Post date:** [March 28, 2024, 12:20pm UTC](https://forums.ankiweb.net/t/change-image-occlusion-box-colour-in-closet-add-on/41671/5 "2024-03-28T12:20:15Z")

</div>

Closed on March 28, 2024, 12:20pm UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
