* Added a 1px margin between the text and the warning icon * Removed vertically aligning the color-mix to middle (all the other swatches are aligned to baseline by default so this will be too) * Normalized `hue` to be between [0 - 360] in LCH and OKLCH Bug: none Change-Id: I47ac345b12f11e435fe754f97f9b3158e89b8f68 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4194333 Reviewed-by: Philip Pfaffe <pfaffe@chromium.org> Commit-Queue: Ergün Erdoğmuş <ergunsh@chromium.org> Auto-Submit: Ergün Erdoğmuş <ergunsh@chromium.org>
Settings
Settings can alter the functionality of DevTools.
Some of the settings default values can be changed with the command menu or in the settings tab.
A settings registration is represented by the SettingRegistration interface, declared in common/SettingRegistration.ts.
All settings have to be registered using the function Common.Settings.registerSettingExtension which expects an object of type SettingRegistration as parameter.
As an example, take the registration of the showHTMLComments settting, which allows users to determine if HTML comments are shown in the Elements tree:
Common.Settings.registerSettingExtension({
category: Common.Settings.SettingCategory.ELEMENTS,
order: 3,
title: ls`Show HTML comments`,
settingName: 'showHTMLComments',
settingType: Common.Settings.SettingType.BOOLEAN,
defaultValue: true,
options: [
{
value: true,
title: ls`Show HTML comments`,
},
{
value: false,
title: ls`Hide HTML comments`,
},
],
});
A controller for the each setting is added to the 'preferences' tab if they are visible, that is, they have a title and a category.
They can also be set with the command menu if they have options and a category (options’ names are added as commands).