-
Notifications
You must be signed in to change notification settings - Fork 29
Semantic color vars #115
Comments
Here is the current proposal that myself, @Scotchester and @virginiacc chatted about today. We'd like to run it by others, especially @ascott1, @contolini, @wernerc, @sephcoster, and @awolfe76. The goal of this proposal is to allow non-CFPB Capital Framework users to more easily customize the framework colors.
I know some of you may be very busy with the incoming fellows so if you do have concerns and can't make it please let me know here. Also if this makes no sense to you or if something isn't clearly explained, please let me know. Capital Framework color variables proposal
What does this achieve?Approaching color variables in this way will force CF-development to assume the How would it work?To add custom branding to a Captial Framework project, you simply need to override ExamplesUpdates to cf-base.less within the cf-core component@link-color: #some-non-cfpb-hex;
@link-color-hover: #another-non-cfpb-hex;
a {
color: @link-color;
&:hover {
colore: @link-color-hover;
}
} Updates to cf-buttons.less within the cf-button component@btn-primary: #some-non-cfpb-hex;
@btn-primary-hover: fade(@btn-primary);
@btn-primary-color: #some-non-cfpb-hex;
@btn-secondary: #some-non-cfpb-hex;
@btn-secondary-hover: fade(@btn-secondary);
@btn-secondary-color: #some-non-cfpb-hex;
.btn {
background: @btn-primary;
color: @btn-primary-color;
&:hover {
background: @btn-primary-hover;
}
}
.btn__secondary {
background: @btn-secondary;
color: @btn-secondary-color;
&:hover {
background: @btn-secondary-hover;
}
} cf-vars-override.less within a CFPB project@import "cf-brand-colors.less";
// cf-core overrides
@link-color: @pacific;
@link-color-hover: @pacific-hover;
// cf-buttons overrides
@btn-primary: @pacific;
@btn-primary-hover: @pacific-80;
@btn-primary-color: @white;
@btn-secondary: @gray;
@btn-secondary-hover: @darkgray;
@btn-secondary-color: @white; An example of cf-vars-override.less within a non-CFPB project// My brand colors
@brand-color: #some-hex;
@primary-action: #some-hex;
@secondary-action: #some-hex;
@white: #some-hex;
// cf-core overrides
@link-color: @primary-action;
@link-color-hover: fade(@primary-action, 50%);
// cf-buttons overrides
@btn-primary: @primary-action;
@btn-primary-hover: fade(@primary-action, 25%);
@btn-primary-color: @white;
@btn-secondary: @secondary-action;
@btn-secondary-hover: darken(@secondary-action, 25%);
@btn-secondary-color: @white; How would this affect current components and projects?All components that specify colors would be updated to use more semantic color How would this affect new projects?We will update cf-generator to ask the user if they want to use the CFPB brand. |
👍 And definitely like the idea of the better variable names, #99. Still meeting today? |
I haven't heard back from a few people so I'll be there at 3 just in case. If no one there has any concerns then it'll be a quick meeting. |
👍 Asking some questions in #dev-tango atm but no concerns here. |
👍 No issues. |
Thanks for the input everyone. I'll move forward with this. 😄 |
This is in progress. generator-cf has been updated ot include the cfpb palette and the override file. cf-buttons has been updated to use vars for each button style. I'll move onto the other components now that those two have been merged. |
@himedlooff Where'd you leave off with this? Is this something I can continue to work on? |
Looks like all of the components are using color variables now so we can close this. |
💓 |
#99 sparked the idea of using better color var names like
@primary-action
instead of straight up using@pacific
.The text was updated successfully, but these errors were encountered: