Colors? Style tags?


#1

Do you know if there is any way to insert vapid into style tags?

Ex: <div class=“metag” style=“background: {{color placeholder=”#dc6000"}};">

Trying to allow CMS to change the color. But I want a default color as well, and placeholder just isn’t working.

Thanks!

edit: nvm i think i figured it out. Thanks!


#2

@jdailey12 Glad to hear you figured it out. I know it’s redundant, but I’m going to answer here anyway, in case others have a similar question.

Yes, template tags can go anywhere, including element attributes like style.

Another fun example is to use a section in the head to create a global theme. e.g.,:

<html>
<head>
  {{#section theme}}
  <link href="https://fonts.googleapis.com/css?family={{font_family type=choice options=Roboto,Oswald,Slabo}}" rel="stylesheet">

  <style>
    body {
      font-family: {{font_family}}, sans-serif;
      color: {{text_color type=choice options=black,white,red default=black}};
      background-color: {{background_color type=choice options=white,black default=white}};
    }
  </style>
  {{/section}}
</head>
<body>
  <h1>My Site</h1>
</body>
</html>