# Perspective base a style class on another style class

**URL:** <https://forum.inductiveautomation.com/t/perspective-base-a-style-class-on-another-style-class/37783>\
**Category:** Ignition\
**Tags:** ignition80, perspective\
**Created:** [August 17, 2020, 1:06am UTC](https://forum.inductiveautomation.com/t/perspective-base-a-style-class-on-another-style-class/37783 "2020-08-17T01:06:59Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [August 17, 2020, 1:06am UTC](https://forum.inductiveautomation.com/t/perspective-base-a-style-class-on-another-style-class/37783/1 "2020-08-17T01:06:59Z")

</div>

v8.0.15

Can I base a style class on another style class?  
Instead of having to either define the same styles twice or assign two styles to a component, I want to be able to add the styles defined in one class into another class, where the same precedence logic would apply as normal: if a particular style has two definitions (one from the linked class and one from the current class), then the current class’ version would take precedence.

Or am I doing Perspective wrong? (really I’m just fumbling along at the moment…)

---

<div class="post-metadata">

**Author:** ![Sanderd17](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/sanderd17/32/8735_2.png) [@Sanderd17](https://forum.inductiveautomation.com/u/Sanderd17)\
**Post date:** [August 17, 2020, 7:18am UTC](https://forum.inductiveautomation.com/t/perspective-base-a-style-class-on-another-style-class/37783/2 "2020-08-17T07:18:03Z")

</div>

In CSS, you can add multiple selectors to a style definition by separating them with a comma.

But I indeed don’t see how that’s possible in perspective yet.

CSS selectors are a pretty complicated grammar when you want to implement complete support for it.

> **[CSS selectors - CSS: Cascading Style Sheets | MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors)**
>
> CSS selectors define the elements to which a set of CSS rules apply.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [August 17, 2020, 3:04pm UTC](https://forum.inductiveautomation.com/t/perspective-base-a-style-class-on-another-style-class/37783/3 "2020-08-17T15:04:21Z")

</div>

Currently, Perspective styles work as dedicated elements - they’re applied by a selector per ID (open a Perspective session in browser dev tools, and you can see the style class CSS) - something like `.psc-{your style class name}` and applied as a classname on each element.

Style class composition is something we’re interested in - a lot of the groundwork of Perspective was built on the assumption users wouldn’t want to learn to be web developers, but y’all have consistently proven us wrong 🙂

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [August 17, 2020, 4:25pm UTC](https://forum.inductiveautomation.com/t/perspective-base-a-style-class-on-another-style-class/37783/4 "2020-08-17T16:25:41Z")

</div>

> [@paul-griffith](#):
>
> was built on the assumption users wouldn’t want to learn to be web developers, but y’all have consistently proven us wrong

Early adopters are a different breed. I lean towards y'all's initial assumption for the long term.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [August 17, 2020, 4:32pm UTC](https://forum.inductiveautomation.com/t/perspective-base-a-style-class-on-another-style-class/37783/5 "2020-08-17T16:32:53Z")

</div>

No reason we can’t take steps to keep both happy by just gating more advanced features behind some level of effort (IE, themes).

---

<div class="post-metadata">

**Author:** ![brad.barbin](https://avatars.discourse-cdn.com/v4/letter/b/e19b73/32.png) [@brad.barbin](https://forum.inductiveautomation.com/u/brad.barbin)\
**Post date:** [August 17, 2020, 5:09pm UTC](https://forum.inductiveautomation.com/t/perspective-base-a-style-class-on-another-style-class/37783/6 "2020-08-17T17:09:05Z")

</div>

Just FYI, this is another vote for css type selectors.

It’s just a better mousetrap IMO. But definitely understand where you guys are coming from.
