You may propose multiple themes for your application. If so, you will also need to choose the right style for markdown highlighting.

Note

  • If you only want to follow the Windows mode, see Light and dark modes. This section also includes useful tips on managing images and syntax highlighting.


Markdown controls are linked to a TMDStyle component. The easiest way to avoid having to change all the styling properties or to link all your controls to a different TMDStyle is to work by assignment. Link all your controls to a single TMDStyle, then use Assign to copy settings from other preset TMDStyles.


procedure TDataModule1.SelectStyle(const aStyleName: string);
begin
  if TStyleManager.TrySetStyle(aStyleName) then
  begin
    if SameText(aStyleName, 'Windows10 Dark') then
      MDActiveStyle.Assign(MDWindow10DarkStyle)

    else if SameText(aStyleName, 'Luna') then
      MDActiveStyle.Assign(MDLunaStyle)

    else MDActiveStyle.Assign(MDWindowStyle);
  end;
end;