Fork me on GitHub
#biff
<
2022-06-06
>
jeffparker20:06:31

I'm enjoying playing with Platypub theme development (Option 2), by mapping new colors in site-opts.edn:

:site/primary "#666666"
 :site/accent "#339933"
 :site/accent-dark "#008040"
 :site/tertiary "#eaf3ee"
Which I believe overwrites tailwind.config.js with the new values:
theme: {
    extend: {
      colors: {
        'primary': '#666666',
        'accent': '#339933',
        'accent-dark': '#008040',
        'tertiary': '#eaf3ee',
      },
    },
  },
This works well, cool! Attempting to use the Open Sans font, I followed an online tailwindcss guide which includes updating tailwind.config.js:
theme: {
    extend: {
      colors: {
        'primary': '#666666',
        'accent': '#339933',
        'accent-dark': '#008040',
        'tertiary': '#eaf3ee',
      },
      fontFamily: {
        body: ['Open Sans', 'sans-serif'],
    },
  },
This gets overwritten. I'm curious what approach is planned for supporting font families config. It's not a priority for me to switch fonts right now, just thought I'd bring it up.

Jacob O'Bryant22:06:37

Glad you're enjoying it! You can change the font now, you just need to edit the tailwind.config.js.TEMPLATE file.

👍 1
Jacob O'Bryant22:06:42

The main thing on the roadmap related to this is "Allow themes to specify custom configuration that they need" (https://github.com/jacobobryant/platypub#todo). site-opts.edn and list-opts.edn are a grab bag of random stuff that I needed to be able to set for http://blog.thesample.ai but didn't have in platypub's schema.clj file yet. Though I don't necessarily want to stick everything from {site,list}-opts.edn into the schema, since I don't want to bloat the schema, and there'll probably be tons of different configuration values that people will need as they develop themes. So need to add some way for themes to extend the data model.

Jacob O'Bryant22:06:39

and so re: font families, that could be added to the schema too, either via the theme data-model-extension mechanism, or possibly into the main platypub schema

jeffparker22:06:49

Thanks, I have the font change working now. I had read that function, somehow missing it was the TEMPLATE file, which makes perfect sense.

👍 1
jeffparker22:06:50

module.exports = {
  content: [
    'public/**/*.html',
  ],
  theme: {
    extend: {
      colors: {
        'primary': '{{site/primary}}',
        'accent': '{{site/accent}}',
        'accent-dark': '{{site/accent-dark}}',
        'tertiary': '{{site/tertiary}}',
      },
      fontFamily: {
        'sans': ['Open Sans'],
      },
    },
  },
  plugins: [
    require('@tailwindcss/forms'),
  ],
}

👌 1