Theming Improvements
With Version 1.5, we have revisited all components in our system to remove any hardcoded color classes, so that the theming you provide works better. We have also added CSS Variables to some components with text so that if a dark theme is applied, the default text color of black is overwritten and text is correctly showing up.
We have tried our best to ensure backwards compatability, nonetheless you should visit parts of your application that has HAPI Elements integrated and make sure that we did not accidentally break the styling. Here are some global theming additions:
borderColor: HexString
placeholderColor: HexString
successSecondaryBackgroundColor: HexString
successSecondaryTextColor: HexString
dangerSecondaryBackgroundColor: HexString
dangerSecondaryTextColor: HexString
warningSecondaryBackgroundColor: HexString
warningSecondaryTextColor: HexString
infoSecondaryBackgroundColor: HexString
infoSecondaryTextColor: HexString
neutralBackgroundColor: HexString
neutralTextColor: HexString
If styling broke in your application after these changes, you should:
- debug in Developer Tools > Elements (DOM) tab
- find the Element that has broken styling
- check which CSS variable it is using (for example
background: var(--hapi-global-neutral-text-color)
) - when setting
window.hapi.theming.state.theme
, pass theneutralBackgroundColor
with a HEX color variable that will fix the styling issue (ortextColor
if that is broken rather than the background color)
Here are the most prominent changes:
- CSS property of
background-color
got changed tobackground
Changes
- Basket styling slightly changed
- Form Select styling slightly changed
- Form HTML Input (Posting Details Description) component styling adapted to Form Input so styling matches
- Form Label Description color changed from hardcoded gray to the
fadedTextColor
variable of Global Theming
Global Theming Additions
successSecondaryTextColor
addeddangerSecondaryTextColor
addedwarningSecondaryTextColor
addedinfoSecondaryTextColor
addedneutralBackgroundColor
addedneutralTextColor
addedplaceholderColor
added
Component Styling Object Additions
modal
addedformFieldLabelBase
addedformFieldLabel
addedformFieldDescriptionBase
addedformFieldDescription
addedformFieldErrorMessageBase
addedformFieldErrorMessage
addedbadgeBase
addedbadgePrimary
addedbadgeSecondary
addedbadgeSuccess
addedbadgeSuccessSecondary
addedbadgeWarning
addedbadgeWarningSecondary
addedbadgeInfo
addedbadgeInfoSecondary
addedbadgeDanger
addedbadgeDangerSecondary
addedbadgeAccent
addedbadgeFaded
addedbadgeNeutral
addedcard
addedcardHeader
addedcheckbox
addedcheckboxPrimary
addedcheckboxSecondary
addedcheckboxSuccess
addedcheckboxSuccessSecondary
addedcheckboxInfo
addedcheckboxInfoSecondary
addedcheckboxDanger
addedcheckboxDangerSecondary
addedcheckboxWarning
addedcheckboxWarningSecondary
addedcheckboxAccent
addedcheckboxFaded
addedcheckboxNeutral
addedtabHeader
addedtabPanel
addedbuttonNeutral
added