Custom settings are also a great thing I discovered. You need to add a settings.yml file to your theme or component’s github repository. Here is a sample component with settings you can customize:
https://github.com/oerog/CustomSettings.git
This is the settings.yml file that sets the variables $header_text, $header_text_color and $header_bg
header_text:
type: bool
default: false
description:
en: 'Select to add text in header next to logo.'
header_text_color:
type: string
default: "$header_primary"
description:
en: 'Text color (default is "header primary")'
header_bg:
type: string
default: "$header_background"
description:
en: 'Text color (default is "header background")'
Which gives you these setting options when you install the component:
Which sets this css
@if $header_text == "true" {
.d-header .title::after {
padding: 0 20px;
font-size: 1.3em;
color: $header_text_color;
background-color:$header_bg;
content: "Here is some text";
}
.archetype-regular #main.no-text .d-header .title::after {
display:none;
}
}
You can install the same component multiple times (just rename it once you’ve installed it to help keep track) so you can add the component to different themes with different settings for each theme.
Here is how you create the settings.yml file. Create a new file:
Enter the code (I write it in a text file and then C&P it):
Save it by “Commit new file”
Then install the component on your site and edit the settings



