Creating a custom theme for your Power Apps project is important. The colors, fonts, icons and styles you use for controls (text inputs, dropdowns, date-pickers, etc.) define the unique look-and-feel of an app. Power Apps does not have a feature to generate a custom theme so I have come up a system that I use in my own apps. In this article I will show you how to build a Power Apps custom theme. Show
Choosing A Color Palette For A Custom ThemeA color palette defines which colors will be used in the Power Apps custom theme. The colors in my palette are organized into 3 categories which I learned from the book Refactoring UI by Adam Wathan and Steve Schoger.
I like to visualize my color palette like this: Using Free Online Tools To Help Build A Color PaletteWhen I need to come up with my own colors palette for an app I there are two free online tools I use. The 1st tool called Coolors randomly generates a set of 5 colors. I keep re-generating the colors until I find one that I like and then I lock it into my palette. Then when I generate the next set of colors I am only presented with colors that go well with my locked in color. I continue to repeat the cycle of locking in colors and regenerating until I have my palette. The 2nd tool I use called Color Hunt is an open collection of palettes created by professional designers. I can choose the look and feel I want using the left-side menu (dark, light, warm, cold, pastel, etc.) and then I am presented with the matching color palettes. Each palette has the number of likes beside it to show the color palette’s popularity. Adding App Colors To A Power Apps Custom ThemeTo create the color palette in Power Apps write this code in the OnStart property of the app.
Then to use a color in our palette (e.g. Primary1) we some code like this. We always choose a color from the palette rather than use the RGBA or Hex values to ensure we remain consistent. Another advantage is if we ever want to swap the primary color for another we can do it with one simple code change.
Selecting Fonts & Sizes For A Custom ThemeA custom theme should include fonts and a set of pre-defined fonts sizes. Power Apps comes with 15 standards fonts:
We can also use custom fonts that are not listed in Power Apps Studio. Custom fonts are not guaranteed to display properly across all devices and web browsers so it is best to test them on any devices you plan to use. The following list of fonts are generally regarded as safe.
It is common for apps to have both a heading font and a body font. The heading font for our sample app is Roboto and and the body font is Lato. I like to use typ.io to help me find fonts that go together. Choosing font sizes is as important as the fonts themselves. Without a set of pre-defined sizes I find that I spend too much time thinking about what size to use and make choices that are inconsistent with the rest of the app. At minimum I choose 5 font sizes: tiny, regular, subtitle, title and huge. Using The Power Apps Custom Fonts Sample App To Pick A FontAdding Fonts & Font Sizes To A Power Apps Custom ThemeTo include fonts and font sizes in our Power Apps custom theme write this code in the OnStart property of the app.
If we wanted to apply the Roboto font to a label we would use this code in the Font property.
Then to make the label’s font size the correct size for a title we can put this code in the Size property.
Picking Icons For A Custom ThemeChoosing icons for a custom theme is optional but they really make app stand-out visually. We can go beyond the set of standard Power Apps icons and introduce our own by using SVG images. The most popular icon sets are:
Pen Warner has compiled all of these icon sets and more into a single Power Apps app holding over 45,000 icons which you can download for free. I highly recommend this solution to anyone who wants more icons. Adding Icons To A Power Apps Custom ThemeWe can define the set of icons in the custom theme by writing this code in the app’s OnStart property.
To use the checkmark icon, simply add this code the Image property of an Image control.
Defining Default Control Styles For A Custom ThemeNow that we have a color palette, fonts, sizes and icons for our custom theme the next step is to choose a default value for every property that could appear inside a control. A control is any element in an app a user can interact with: a text input, a dropdown, a button, etc. Figuring out the defaults in advance makes it easier to maintain a consistent style in the app. Write this code in the OnStart property of the app.
Defining Power Apps Controls StylesEach control must have its style applied manually. The pre-work we’ve done will make it go faster, but its still tedious to do the 1st time. Fortunately, the next time we need a custom theme we can work from the same template. To cut-down on repetition I like to have a copy of each control saved on a special screen in the app that is only accessible in studio-mode. For each control type, define the style as shown below and place this code in the OnStart property of the app.
Full Custom Theme Code Block For App OnStartOnce the custom theme is fully-completed the code block in the app’s OnStart property should look like this:
Using A Pre-Built Branding Template AppBuilding your own Power Apps custom theme is a lot of work. Sancho Harker has created a free Branding Template App to make custom themes easy.
The Branding Template can hold several different themes and change them on-the-fly. This gives us the ability to build a light-mode theme, a dark-mode theme, a high-contrast theme and include them all in the same app. It also generates new controls with the theme already applied to them. This feature is amazing! Did You Enjoy This Article? 😺Subscribe to get new Power Apps articles sent to your inbox each week for FREE Questions? If you have any questions about Create A Power Apps Custom Theme – Colors, Fonts, Icons & Controls please leave a message in the comments section below. You can post using your email address and are not required to create an account to join the discussion. What is a theme in Access?Themes are built-in collections of formats such as font sizes, colors, and alignments you can quickly apply to a form or report. Themes are a great feature if you want your forms and reports to look sharp and professional but don't have the time to format them yourself.
What type of database system is Access?Microsoft Access is a file server-based database. Unlike client–server relational database management systems (RDBMS), Microsoft Access does not implement database triggers, stored procedures, or transaction logging. Access 2010 includes table-level triggers and stored procedures built into the ACE data engine.
What is the report Wizard?The Report Wizard is a feature in Access that guides you through a series of questions and then generates a report based on your answers.
|