# Tutor Indigo (tutor-indigo) – Multiple Themes Configuration

**URL:** <https://discuss.openedx.org/t/tutor-indigo-tutor-indigo-multiple-themes-configuration/7759>\
**Category:** Site Operations Help\
**Tags:** tutor\
**Created:** [July 7, 2022, 7:05pm UTC](https://discuss.openedx.org/t/tutor-indigo-tutor-indigo-multiple-themes-configuration/7759 "2022-07-07T19:05:44Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zachary\_Trabookis](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/zachary_trabookis/32/753_2.png) [@Zachary\_Trabookis](https://discuss.openedx.org/u/Zachary_Trabookis)\
**Post date:** [July 7, 2022, 7:05pm UTC](https://discuss.openedx.org/t/tutor-indigo-tutor-indigo-multiple-themes-configuration/7759/1 "2022-07-07T19:05:44Z")

</div>

Working with the following configuration:

- Tutor Maple Release (13.3.1)
- Tutor Indigo (commits right before v14.0.0 tag)

We’re trying to serve multiple site themes from one installation of Open edX platform and we’re wondering if we should have separate tutor plugins (based on tutor-indigo) for the different site themes or should we just put all themes in separate directory located within the `tutor-indigo` plugin located at [tutor-indigo/tutorindigo/templates at v14.0.0 · overhangio/tutor-indigo · GitHub](https://github.com/overhangio/tutor-indigo/tree/v14.0.0/tutorindigo/templates) directory?

To make this happen we’ve done both ways below:

1. Put all site themes in [tutor-indigo/tutorindigo/templates at v14.0.0 · overhangio/tutor-indigo · GitHub](https://github.com/overhangio/tutor-indigo/tree/v14.0.0/tutorindigo/templates) directory separated directories (e.g. indigo, theme1, theme2)
2. Make separate tutor plugins for `tutor-theme1` and `tutor-theme2` based on `tutor-indigo` theme.

**Copying Theme Files to Tutor Environment**  
To make sure that we copy files to the Tutor environment we update this code [tutor-indigo/plugin.py at v14.0.0 · overhangio/tutor-indigo · GitHub](https://github.com/overhangio/tutor-indigo/blob/v14.0.0/tutorindigo/plugin.py#L39-L43)

To push out the theme files to the tutor environment at `/Users/<username>/Library/Application Support/tutor/env/build/openedx/themes` we issue the following command.

```auto
(venv)<username>@000-127-116-182 tutor % tutor config save
Configuration saved to /Users/<username>/Library/Application Support/tutor/config.yml
Environment generated in /Users/<username>/Library/Application Support/tutor/env

```

```auto
# /Users/<username>/Library/Application Support/tutor-plugins/tutor-indigo/tutorindigo/plugins.py
# Outputs to tutor environment at env/build/openedx/themes/indigo/ directory
hooks.Filters.ENV_TEMPLATE_TARGETS.add_items(
    [
        ("indigo", "build/openedx/themes"),
    ],
)

# /Users/<username>/Library/Application Support/tutor-plugins/tutor-theme1/tutortheme1/plugins.py
# Outputs to tutor environment at env/build/openedx/themes/theme1/ directory
hooks.Filters.ENV_TEMPLATE_TARGETS.add_items(
    [
        ("theme1", "build/openedx/themes"),
    ],
)

# /Users/<username>/Library/Application Support/tutor-plugins/tutor-theme2/tutortheme2/plugins.py
# Outputs to tutor environment at env/build/openedx/themes/theme2/ directory
hooks.Filters.ENV_TEMPLATE_TARGETS.add_items(
    [
        ("theme2", "build/openedx/themes"),
    ],
)

```

This configuration copies the theme files out to the tutor environment at /Users//Library/Application Support/tutor/env/build/openedx/themes.

![image](https://us1.discourse-cdn.com/flex020/uploads/openedx/original/2X/a/a855af7b88e4ea6b5b74c55fc890f1cce4e4098b.png)

**SASS Compiling**  
To make this push out SASS files we add this additional Tutor configuration under `./tutor-theme/tutortheme/plugin.py`.

```auto
# Copy the SCSS partial files over to the tutor env. It appears this partials directory is 
# ignored by default by tutor/env.py `ENV_PATTERNS_IGNORE`.
hooks.Filters.ENV_PATTERNS_INCLUDE.add_items(
    [
        # Include files from "partials" folders
        r"(.*/)?partials(/.*)?$",
    ]
)

```

Show in the image below we have the SCSS files coming across into the tutor environment at `/Users/<username>/Library/Application Support/tutor/env/build/openedx/themes`, however, the `watchtheme` only finds SCSS files in the `indigo` theme to recompile.

 ![image](https://us1.discourse-cdn.com/flex020/uploads/openedx/original/2X/5/5d4a0452b7c8e76ae6b9ee115c05bcf455163b4f.png)

We’re noticing that the `watchthemes` container is only compiling SASS for the `indigo` theme.  
Here is the log file for the `watchthemes` container.

```auto
        Recompiling indigo theme for lms
rtlcss /openedx/themes/indigo/lms/static/css/discussion/lms-discussion-bootstrap.css /openedx/themes/indigo/lms/static/css/discussion/lms-discussion-bootstrap-rtl.css
rtlcss: Warning! No config present, using defaults.
Saving: /openedx/themes/indigo/lms/static/css/discussion/lms-discussion-bootstrap-rtl.css
rtlcss /openedx/themes/indigo/lms/static/css/bootstrap/lms-main.css /openedx/themes/indigo/lms/static/css/bootstrap/lms-main-rtl.css
rtlcss: Warning! No config present, using defaults.
Saving: /openedx/themes/indigo/lms/static/css/bootstrap/lms-main-rtl.css
 Sass dir '/openedx/themes/indigo/lms/static/certificates/sass' does not exists, skipping sass compilation for '/openedx/themes/indigo' 
        Done recompiling indigo theme for lms

```

cc: @regis, @becdavid, @traek728

---

<div class="post-metadata">

**Author:** ![Zachary\_Trabookis](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/zachary_trabookis/32/753_2.png) [@Zachary\_Trabookis](https://discuss.openedx.org/u/Zachary_Trabookis)\
**Post date:** [July 7, 2022, 8:10pm UTC](https://discuss.openedx.org/t/tutor-indigo-tutor-indigo-multiple-themes-configuration/7759/2 "2022-07-07T20:10:46Z")

</div>

Whenever I save any \*.scss file in the theme’s tutor environment directory (e.g. `tutor environment at env/build/openedx/themes/theme2/`) the `watchthemes` recompiles it. I’m just curious why it only picks up the `tutor-indigo` theme only.

Also curious how we handle multiple tutor themes on single install of `tutor local`. Is it through multiple plugins for each theme or can we put all themes inside of `tutor-indigo`?

---

<div class="post-metadata">

**Author:** ![Zachary\_Trabookis](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/zachary_trabookis/32/753_2.png) [@Zachary\_Trabookis](https://discuss.openedx.org/u/Zachary_Trabookis)\
**Post date:** [July 7, 2022, 8:28pm UTC](https://discuss.openedx.org/t/tutor-indigo-tutor-indigo-multiple-themes-configuration/7759/3 "2022-07-07T20:28:03Z")

</div>

To get around the `watchthemes` not compiling all themes I attached to the `watchthemes` container and ran the following.

```auto
app@5668b9b3c895:~/edx-platform$ openedx-assets themes

Compiling lms sass assets from theme /openedx/themes/theme1...
rtlcss /openedx/themes/theme1/lms/static/css/discussion/lms-discussion-bootstrap.css /openedx/themes/theme1/lms/static/css/discussion/lms-discussion-bootstrap-rtl.css
rtlcss: Warning! No config present, using defaults.
Saving: /openedx/themes/theme1/lms/static/css/discussion/lms-discussion-bootstrap-rtl.css
rtlcss /openedx/themes/theme1/lms/static/css/bootstrap/lms-main.css /openedx/themes/theme1/lms/static/css/bootstrap/lms-main-rtl.css
rtlcss: Warning! No config present, using defaults.
Saving: /openedx/themes/theme1/lms/static/css/bootstrap/lms-main-rtl.css
Compiling cms sass assets from theme /openedx/themes/theme1...

Compiling lms sass assets from theme /openedx/themes/theme2...
rtlcss /openedx/themes/theme2/lms/static/css/discussion/lms-discussion-bootstrap.css /openedx/themes/theme2/lms/static/css/discussion/lms-discussion-bootstrap-rtl.css
rtlcss: Warning! No config present, using defaults.
Saving: /openedx/themes/theme2/lms/static/css/discussion/lms-discussion-bootstrap-rtl.css
rtlcss /openedx/themes/theme2/lms/static/css/bootstrap/lms-main.css /openedx/themes/theme2/lms/static/css/bootstrap/lms-main-rtl.css
rtlcss: Warning! No config present, using defaults.
Saving: /openedx/themes/theme2/lms/static/css/bootstrap/lms-main-rtl.css
Compiling cms sass assets from theme /openedx/themes/theme2...

Compiling lms sass assets from theme /openedx/themes/indigo...
rtlcss /openedx/themes/indigo/lms/static/css/discussion/lms-discussion-bootstrap.css /openedx/themes/indigo/lms/static/css/discussion/lms-discussion-bootstrap-rtl.css
rtlcss: Warning! No config present, using defaults.
Saving: /openedx/themes/indigo/lms/static/css/discussion/lms-discussion-bootstrap-rtl.css
rtlcss /openedx/themes/indigo/lms/static/css/bootstrap/lms-main.css /openedx/themes/indigo/lms/static/css/bootstrap/lms-main-rtl.css
rtlcss: Warning! No config present, using defaults.
Saving: /openedx/themes/indigo/lms/static/css/bootstrap/lms-main-rtl.css
Compiling cms sass assets from theme /openedx/themes/indigo...

```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex020/uploads/openedx/original/2X/e/e0015f89e879bc75925b71fd11133ab15fe98297.png) [@system](https://discuss.openedx.org/u/system)\
**Post date:** [October 5, 2022, 8:29pm UTC](https://discuss.openedx.org/t/tutor-indigo-tutor-indigo-multiple-themes-configuration/7759/4 "2022-10-05T20:29:01Z")

</div>

Closed on October 5, 2022, 8:29pm UTC

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