# Theme component order of precedence

**URL:** <https://meta.discourse.org/t/theme-component-order-of-precedence/156615>\
**Category:** Development\
**Created:** [2 juli 2020 om 15:13 UTC](https://meta.discourse.org/t/theme-component-order-of-precedence/156615 "2020-07-02T15:13:16Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![guildai](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/guildai/32/248544_2.png) [@guildai](https://meta.discourse.org/u/guildai)\
**Post date:** [3 juli 2020 om 22:32 UTC](https://meta.discourse.org/t/theme-component-order-of-precedence/156615/4 "2020-07-03T22:32:00Z")

</div>

I noticed that in my attempt to reorder JavaScript execution by reinstalling and uninstalling the TOC component (this has the fortuitous side effect, seemingly, of running the TOC JavaScript _last_) that the CSS rules are now applied using this order 🙂

I feel like the topic of ordering for theme component code-placement is pretty important. If the ordering is officially “undefined” there’s no way components can hope to interact.

Perhaps component interaction is a non-goal. But I think with an ordering heuristic (e.g. declare that a component file occur _before_ or _after_ another component’s file of the the same name - this would presumably be defined in about.json) this problem is not-so-hard.

For my part, I’m starting to think that forking the TOC component is the right course based on what I’m trying to do.

---

_[View the full topic](https://meta.discourse.org/t/theme-component-order-of-precedence/156615)._
