Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to add custom color to post-cards? #132

Open
agarnung opened this issue Jan 29, 2025 · 0 comments
Open

How to add custom color to post-cards? #132

agarnung opened this issue Jan 29, 2025 · 0 comments

Comments

@agarnung
Copy link

Hello,

First of all, congratulations on the fantastic template.

I would like to know if it's possible to specify and use custom colors or color mixes for the postcards _includes/_post.card.html, or specify things like rgb(.), rgba(.) directly with the template. I've been looking through the Bootstrap documentation and other sources, but I can't seem to figure it out. The most intuitive way seems to be to define our variables in _sass/_variables.scss, but the trail doesn't lead anywhere further. I tried adding the new color directly in the HTML, bypassing the bg- prefix:

{%- if post.style == 'fill' -%}
  {%- if post.color == 'custom' and post.custom_color != nil -%}
    {%- assign card_style = 'background-color:' | append: post.custom_color -%}  <!-- Using custom color -->
  {%- else -%}
    {%- assign card_style = 'bg-' | append: post.color -%}  <!-- Predefined colors -->
  {%- endif -%}
[...]

But it simply renders with a default or undefined dark color; it doesn't seem to accept custom values.

It might be due to my lack of understanding of how this system works, so I'm asking for help.

Thank you so much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant