0

I am defining css variable like

<style type="text/css">
      @variables {
        static:{{STATIC_ROOT_PATH}};
      }
    </style>

I want to use this variable while framing image path. Is it possible something like

background: transparent url('var(static)/images/button_bg.png')

This code is not working for me.

How can I frame image path based on static value ?

3
  • what is the value of {STATIC_ROOT_PATH} Commented Dec 26, 2011 at 6:09
  • It will be generated on fly example //stackoverflow.com/staic Commented Dec 26, 2011 at 6:10
  • Note that this would be a potential vulnerability, you could stehel css variable content if it were allowed to embed css. Commented Sep 18, 2019 at 15:59

1 Answer 1

2

I don't believe that variables are an implemented part of CSS3 at this time. A quick google search returns only articles debating the usefulness of said variables.

I saw earlier someone posted about this extension: http://sass-lang.com/, which allows variables and mix-ins, you may want to look into that?

Someone comment and correct me if I'm wrong.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.