# Funktionen und Variablen

**URL:** https://meta.discourse.org/t/functions-and-variables/86513
**Category:** Support
**Created:** [1. Mai 2018 um 06:48 UTC](https://meta.discourse.org/t/functions-and-variables/86513 "2018-05-01T06:48:48Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![BlackKnob](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/blackknob/32/93549_2.png) [@BlackKnob](https://meta.discourse.org/u/BlackKnob)
#### Post date: [1. Mai 2018 um 06:48 UTC](https://meta.discourse.org/t/functions-and-variables/86513/1 "2018-05-01T06:48:49Z")

</div>

Is it possible to get access to functions and variables from Discourse variables.scss?

When I edit my theme, I can reference _$primary_, _$secondary_ etc.  
_$primary-low_ or _dark-light-choose()_ are not available though.

Would adding `@import "./variables";` to my theme be an overkill?

---

<div class="post-metadata">

### Author: ![Johani](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/johani/32/176920_2.png) [@Johani](https://meta.discourse.org/u/Johani)
#### Post date: [2. Mai 2018 um 02:15 UTC](https://meta.discourse.org/t/functions-and-variables/86513/2 "2018-05-02T02:15:36Z")

</div>

> [@BlackKnob](#):
>
> Is it possible to get access to functions and variables from Discourse variables.scss?

Yes!

> [@BlackKnob](#):
>
> When I edit my theme, I can reference $primary, $secondary etc.
> 
> $primary-low or dark-light-choose() are not available though.

The short answer is because `$primary`, `$secondary` etc are injected in by Discourse while the more complex variables are not.

And so, you’re correct, you’d have to import them first.

I use

`@import "common/foundation/variables"`

The long answer is here:

> [@Use Discourse Core Variables in your Theme](https://meta.discourse.org/t/how-to-use-discourse-core-variables-in-your-theme/77551):
>
> Discourse is incredibly customizable! The goal of this topic is to show you how make use of all the amazing options that are available to you as a theme developer. You know… so that you don’t have to reinvent the wheel smileVariables? What variables? Variables cover a large number of things, from font sizes to colors to z-index values. You can use and override the vast majority of variables in your theme editor. Colors There are many colors available for you to use or override in your them…

> [@BlackKnob](#):
>
> Would adding @import “./variables”; to my theme be an overkill?

No, it’s not an overkill because they will not be a part of the compiled CSS sheet sent to the client.

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [30. März 2022 um 17:11 UTC](https://meta.discourse.org/t/functions-and-variables/86513/4 "2022-03-30T17:11:07Z")

</div>



---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [29. April 2022 um 17:11 UTC](https://meta.discourse.org/t/functions-and-variables/86513/5 "2022-04-29T17:11:43Z")

</div>

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