Skip to main content
Version: 3.x

Styling

Overriding style properties

You can globally customize styles by overiding some classes it will be applied to all components. There severale type of properi that can be override Colors, Wording, Typography, Icons / Images and Dimentions

Colors

Colors can be globally overriden by redefining them in your main assets file.

color override sample

Exhaustive color list and default values 👇
Name Default value
miamBlack#252525
miamBlack20#202020
miamBorder#DDDDDD
miamBorderLight#E9E9E9
miamDanger#F47F7A
miamGrey#676767
miamGreySurface#EDEDED
miamInfo#44D6B3
miamLightGrey#9F9F9F
miamMusterd#FFC700
miamNeutralGrey#575756
miamPrimary#037E92
miamPrimaryDark#005562
miamPrimaryLight#BED5DC
miamPrimaryLighter#F3F9FA
miamPrimaryText#007E92
miamSecondary#E61845
miamSecondaryText#4B555D
miamSuccess#44D6B3
miamTernary#209B8F
miamUnpureWhite#FEFEFE
miamWarning#FFDAA3
miamWhite#FAFCFE

Wording

There is two way to override Text in the SDK

  • By assigning a new value to MiamText (deprecated)
  • By using I18n resolver (recommended)

Using MiamText

  MiamText.sharedInstance.alreadyInCart = "ok done"

Icons / Images

Icons can be globally overriden by redefining them in your main assets file.

icon override sample

Exhaustive icon list and default values 👇
Name Default icon

Dimensions

Templating

You can provide your own swiftUi template and map it with our controller All cutomizable elements are availables in theme/Template.swift


Template.sharedInstance.counterTemplate =
{(count: Int,
increase: @escaping () -> Void,
decrease: @escaping () -> Void ) -> AnyView in
AnyView(
HStack{
Button(action: {
decrease()
}) {
Image(systemName: "minus.circle.fill").foregroundColor(.red)
}
Text(String(count))
Button(action: {
increase()
}) {
Image(systemName: "plus.circle").foregroundColor(.blue)
}
}
)}

New templating system

Starting in version 4.0.0 we will progressively be moving away from the Template singleton. It will be replaced by protocols that you will need to implement.

All views used in the meal planner are implemented using the new templating system.

ProtocolUsed to
MealPlannerCallToActionReplace the content of the button used on homepage or lists to access the meal planner
MealPlannerFormReplace the content of the form used to specify your budget in the meal planner
MealPlannerSuccessReplace the content of the meal planner results view
MealPlannerEmptyReplace the content of meal planner view when there are no results
MealPlannerFooterReplace the footer in meal planner view
MealPlannerLoadingReplace the loader in meal planner view
MealPlannerToolbarReplace the toolbar in meal planner view
MealPlannerRecapReplace the content of meal planner recap view
MealPlannerRecipeCardReplace the content of meal planner recipe card view
MealPlannerRecipeCardLoadingReplace the loader in meal planner recipe card view
MealPlannerRecipePlaceholderReplace the content of meal planner recipe card view when there's no recipe
MealPlannerSearchReplace the content of
MealPlannerBasketPreviewEmptyReplace the content of meal planner basket preview view when the basket is empty
MealPlannerBasketPreviewLoadingReplace the content of meal planner basket preview view when the basket is loading
MealPlannerBasketPreviewProductReplace the product's information in meal planner basket preview view
MealPlannerBasketPreviewRecipeOverviewReplace recipe details' content in meal planner basket preview view
MealPlannerBasketPreviewSectionTitleReplace a section title in meal planner basket preview view
MealPlannerBasketPreviewFooterReplace the footer in meal planner basket preview view
MealPlannerBaskletPreviewSectionProductReplace a not yet in basket product's information in meal planner basket preview view