Event Tags can be utilized used to identify specify Event Locations or Event Categories on an Events page. Here’s how to customize Here's a guide to customizing your Event Tags. For more details additional information on creating an event, please refer to the Events article.
...
To update this file yourself, use the local development set-up included in the Bitbucket repo to pull and update the following template file: templates/content/node--event.html.twig.
Once you’re inside the twig Twig file, you can now do either of the followingchoose to:
...
To display a tag icon, add the css classname CSS class
.events-tag
. To hide the tag icon, delete remove the.events-tag
class.To display the light button styled design, ensure that .events-btn-light is in replacement of .events-btn-darkFor a light button style, replace
.events-btn-dark
with.events-btn-light
.Additionally, add the following styles to your SCSS files.
Using the
@mixin tag-bg($color)
variable will help apply your college colors to the event tag icon. See below for details.
...
You should also incorporate your branding into the
events.scss
file. Here’s how to do that:Here’s an example of how the code should look:
Code Block |
---|
// Events Article
.events {
&-category {
a {
color: $white;
&:hover, &:focus {
background-color: darken($gray-500, 15%);
}
}
}
// Event Tag
&-tag {
a {
@include tag-bg('%23002b5c');
}
}
&-tag.events-btn-light {
a {
&:hover, &:focus {
@include tag-bg('%23002b5c');
}
}
}
&-tag.events-btn-dark {
a {
&:hover, &:focus {
@include tag-bg('%23ffffff');
}
}
}
&-btn-light {
a {
background-color: $gray-100;
color: $gray-700;
&:hover, &:focus {
background-color: darken($gray-100, 7.5%);
color: $gray-700;
}
}
}
&-btn-dark {
a {
background-color: $gray-100;
color: $gray-700;
&:hover, &:focus {
background-color: $primary;
color: $white;
}
}
}
// end
} |
Be sure to replace the color values with your college's brand colors. One of the color values must be in Base64 format for the tag icon. Use a URL-encoder for SVG tool to convert a standard hex color value into a Base64 value. Although this tool is typically used for SVG graphics, it can also be applied to hex values.
Code Block // Event Tag &-tag { a { @include tag-bg('%23002b5c'); } } &-tag.events-btn-light { a { &:hover, &:focus { @include tag-bg('%23002b5c'); } } }
Ensure that the
.events-btn-dark
CSS class uses your college’s primary colors.
Code Block |
---|
&-btn-dark {
a {
background-color: $gray-100;
color: $gray-700;
&:hover, &:focus {
background-color: $primary;
color: $white;
}
}
}
|
Finally, make sure to include the new
events.scss
file in your mainstyle.scss
.
...