finalize margin classes

This commit is contained in:
yoy 2025-10-10 14:14:45 +02:00
parent 3d1487ef4a
commit b79e64f8a3
27 changed files with 44 additions and 69 deletions

View file

@ -13,7 +13,7 @@ export type ActionBarAttrs = {
export class ActionBar implements Component<ActionBarAttrs> { export class ActionBar implements Component<ActionBarAttrs> {
view(vnode: Vnode<ActionBarAttrs>): Children { view(vnode: Vnode<ActionBarAttrs>): Children {
return m( return m(
".action-bar.flex-end.items-center.ml-between-s", ".action-bar.flex-end.items-center.ml-between-4",
vnode.attrs.buttons.map((b) => m(IconButton, b)), vnode.attrs.buttons.map((b) => m(IconButton, b)),
) )
} }

View file

@ -42,7 +42,7 @@ export class DialogHeaderBar implements Component<DialogHeaderBarAttrs> {
}, },
[ [
m( m(
columnClass + ".ml-negative-s", columnClass + ".ml-negative-8",
resolveMaybeLazy(a.left).map((a) => m(Button, a)), resolveMaybeLazy(a.left).map((a) => m(Button, a)),
), // ellipsis is not working if the text is directly in the flex element, so create a child div for it ), // ellipsis is not working if the text is directly in the flex element, so create a child div for it
a.middle a.middle
@ -55,7 +55,7 @@ export class DialogHeaderBar implements Component<DialogHeaderBarAttrs> {
) )
: null, : null,
m( m(
columnClass + ".mr-negative-s.flex.justify-end", columnClass + ".mr-negative-8.flex.justify-end",
resolveMaybeLazy(a.right).map((a) => m(Button, a)), resolveMaybeLazy(a.right).map((a) => m(Button, a)),
), ),
], ],

View file

@ -58,7 +58,7 @@ export class InfoBanner implements Component<InfoBannerAttrs> {
{ style: { "margin-left": px(size.icon_24 + 1) } }, // allow room for the icon { style: { "margin-left": px(size.icon_24 + 1) } }, // allow room for the icon
[ [
m(".mr-12.pt-s.pb-s", typeof message === "function" ? message() : m(".small.text-break", lang.get(message))), m(".mr-12.pt-s.pb-s", typeof message === "function" ? message() : m(".small.text-break", lang.get(message))),
m(".flex.ml-negative-s", { style: buttonContainerStyle }, [this.renderButtons(buttons), this.renderHelpLink(helpLink)]), m(".flex.ml-negative-8", { style: buttonContainerStyle }, [this.renderButtons(buttons), this.renderHelpLink(helpLink)]),
], ],
), ),
], ],

View file

@ -56,7 +56,7 @@ export class RadioSelector<T> implements Component<RadioSelectorAttrs<T>> {
}, },
}, },
[ [
m("input[type=radio].m-0.mr-button.content-accent-accent", { m("input[type=radio].m-0.mr-8.content-accent-accent", {
/* The `name` attribute defines the group the radio button belongs to. Not the name/label of the radio button itself. /* The `name` attribute defines the group the radio button belongs to. Not the name/label of the radio button itself.
* See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/radio#defining_a_radio_group * See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/radio#defining_a_radio_group
*/ */

View file

@ -10,7 +10,7 @@ export type Attrs = {
export class RecipientButton implements Component<Attrs> { export class RecipientButton implements Component<Attrs> {
view({ attrs }: Vnode<Attrs>): Children { view({ attrs }: Vnode<Attrs>): Children {
return m( return m(
"button.mr-button.content-accent-fg.print.small", "button.mr-8.content-accent-fg.print.small",
{ {
style: Object.assign( style: Object.assign(
{ {

View file

@ -58,7 +58,7 @@ export class RichTextToolbar implements Component<RichTextToolbarAttrs> {
}, },
[ [
m( m(
".flex-end.wrap.items-center.mb-4.mt-4.ml-between-s", ".flex-end.wrap.items-center.mb-4.mt-4.ml-between-4",
this.renderStyleButtons(attrs), this.renderStyleButtons(attrs),
this.renderCustomButtons(attrs), this.renderCustomButtons(attrs),
this.renderAlignDropDown(attrs), this.renderAlignDropDown(attrs),

View file

@ -44,12 +44,12 @@ export class RowButton implements Component<RowButtonAttrs> {
? m(Icon, { ? m(Icon, {
icon: attrs.icon, icon: attrs.icon,
container: "div", container: "div",
class: "mr-button", class: "mr-8",
style: { fill: color }, style: { fill: color },
size: IconSize.PX24, size: IconSize.PX24,
}) })
: attrs.icon === "none" : attrs.icon === "none"
? m(".icon-24.mr-button") ? m(".icon-24.mr-8")
: null, : null,
class: "flex items-center state-bg button-content plr-button " + attrs.class, class: "flex items-center state-bg button-content plr-button " + attrs.class,
style: { style: {

View file

@ -32,7 +32,7 @@ export async function showProgressDialog<T>(
headerBarAttrs headerBarAttrs
? m(DialogHeaderBar, { ? m(DialogHeaderBar, {
...headerBarAttrs, ...headerBarAttrs,
class: "mb-32 mt-negative-l mr-negative-l ml-negative-l", class: "mb-32 mt-negative-24 mr-negative-24 ml-negative-24",
}) })
: null, : null,
m( m(

View file

@ -591,54 +591,32 @@ styles.registerStyle("main", () => {
".pl-button": { ".pl-button": {
"padding-left": px(size.spacing_8), "padding-left": px(size.spacing_8),
}, },
".mr-button": { ".mt-negative-8": {
"margin-right": px(size.spacing_8),
},
".ml-button": {
"margin-left": px(size.spacing_8),
},
".mt-negative-hpad-button": {
"margin-top": px(-size.spacing_8), "margin-top": px(-size.spacing_8),
}, },
".mt-negative-s": { ".mt-negative-24": {
"margin-top": px(-size.spacing_8),
},
".mt-negative-m": {
"margin-top": px(-size.spacing_16),
},
".mt-negative-l": {
"margin-top": px(-size.spacing_24), "margin-top": px(-size.spacing_24),
}, },
".mr-negative-s": { ".mr-negative-8": {
"margin-right": px(-size.spacing_8), "margin-right": px(-size.spacing_8),
}, },
".mr-negative-l": { ".mr-negative-24": {
"margin-right": px(-size.spacing_24), "margin-right": px(-size.spacing_24),
}, },
".ml-negative-s": { ".ml-negative-8": {
"margin-left": px(-size.spacing_8), "margin-left": px(-size.spacing_8),
}, },
// negative margin to handle the default padding of a button // negative margin to handle the default padding of a button
".ml-negative-l": { ".ml-negative-24": {
"margin-left": px(-size.spacing_24), "margin-left": px(-size.spacing_24),
}, },
".ml-negative-xs": {
"margin-left": px(-3),
},
".ml-negative-bubble": {
"margin-left": px(-7),
},
".mr-negative-m": {
"margin-right": px(-(size.spacing_8 + size.spacing_8)),
},
// negative margin to handle the padding of a nav button
".fixed-bottom-right": { ".fixed-bottom-right": {
position: "fixed", position: "fixed",
bottom: px(size.spacing_12), bottom: px(size.spacing_12),
right: px(size.spacing_24), right: px(size.spacing_24),
}, },
".mr-negative-xs": { ".mr-negative-4": {
"margin-right": px(-3), "margin-right": px(-size.base_4),
}, },
// common setting // common setting
".text-ellipsis": { ".text-ellipsis": {
@ -1858,15 +1836,12 @@ styles.registerStyle("main", () => {
width: "initial", width: "initial",
"margin-left": "auto", "margin-left": "auto",
}, },
".ml-between-s > :not(:first-child)": { ".ml-between-4 > :not(:first-child)": {
"margin-left": px(size.spacing_4), "margin-left": px(size.spacing_4),
}, },
".mt-between-s > :not(:first-child)": { ".mt-between-4 > :not(:first-child)": {
"margin-top": px(size.spacing_4), "margin-top": px(size.spacing_4),
}, },
".mt-between-m > :not(:first-child)": {
"margin-top": px(size.spacing_12),
},
// dropdown // dropdown
".dropdown-panel": { ".dropdown-panel": {
position: "absolute", position: "absolute",

View file

@ -320,7 +320,7 @@ export class LoginView extends BaseTopLevelView implements TopLevelView<LoginVie
} }
_renderAppButtons(): Children { _renderAppButtons(): Children {
return m(".flex-center.pt-l.ml-between-s", [ return m(".flex-center.pt-l.ml-between-4", [
client.isDesktopDevice() || client.device === DeviceType.ANDROID client.isDesktopDevice() || client.device === DeviceType.ANDROID
? m(IconButton, { ? m(IconButton, {
title: "appInfoAndroidImageAlt_alt", title: "appInfoAndroidImageAlt_alt",

View file

@ -234,7 +234,7 @@ export async function showErrorDialogNotLoggedIn(e: ErrorInfo): Promise<void> {
}, },
[ [
m( m(
"div.mr-negative-xs", "div.mr-negative-4",
m(ExpanderButton, { m(ExpanderButton, {
expanded: expanded(), expanded: expanded(),
onExpandedChange: expanded, onExpandedChange: expanded,

View file

@ -53,6 +53,6 @@ export class IdentifierRow implements Component<IdentifierRowAttrs> {
const identifierText = formatIdentifier const identifierText = formatIdentifier
? neverNull(identifier.match(/.{2}/g)).map((el, i) => m("span.pr-s" + (i % 2 === 0 ? ".b" : ""), el)) ? neverNull(identifier.match(/.{2}/g)).map((el, i) => m("span.pr-s" + (i % 2 === 0 ? ".b" : ""), el))
: identifier : identifier
return m(".text-break.small.monospace.mt-negative-hpad-button.selectable", identifierText) return m(".text-break.small.monospace.mt-negative-8.selectable", identifierText)
} }
} }

View file

@ -107,7 +107,7 @@ export class UserListView implements UpdatableSettingsViewer {
placeholder: lang.get("searchUsers_placeholder"), placeholder: lang.get("searchUsers_placeholder"),
} satisfies BaseSearchBarAttrs), } satisfies BaseSearchBarAttrs),
m( m(
".mr-negative-s", ".mr-negative-8",
m(IconButton, { m(IconButton, {
title: "addUsers_action", title: "addUsers_action",
icon: Icons.Add, icon: Icons.Add,

View file

@ -36,7 +36,7 @@ export class WhitelabelBrandingDomainSettings implements Component<WhitelabelBra
helpLabel: this.renderWhitelabelInfo(certificateInfo), helpLabel: this.renderWhitelabelInfo(certificateInfo),
isReadOnly: true, isReadOnly: true,
injectionsRight: () => injectionsRight: () =>
m(".ml-between-s", [ m(".ml-between-4", [
whitelabelDomain ? this.renderDeactivateButton(whitelabelDomain) : null, whitelabelDomain ? this.renderDeactivateButton(whitelabelDomain) : null,
customerInfo ? this._renderEditButton(customerInfo, certificateInfo, isWhitelabelFeatureEnabled) : null, customerInfo ? this._renderEditButton(customerInfo, certificateInfo, isWhitelabelFeatureEnabled) : null,
]), ]),

View file

@ -401,7 +401,7 @@ export class MailEditor implements Component<MailEditorAttrs> {
m.render( m.render(
quoteIndicator, quoteIndicator,
m( m(
".ml-button.fit-content", ".ml-8.fit-content",
{ {
style: { style: {
borderRadius: "25%", borderRadius: "25%",
@ -502,7 +502,7 @@ export class MailEditor implements Component<MailEditorAttrs> {
value: model.getSubject(), value: model.getSubject(),
oninput: (val) => model.setSubject(val), oninput: (val) => model.setSubject(val),
injectionsRight: () => injectionsRight: () =>
m(".flex.end.ml-between-s.items-center", [ m(".flex.end.ml-between-4.items-center", [
isDarkTheme() isDarkTheme()
? m(IconButton, { ? m(IconButton, {
title: "viewInLightMode_action", title: "viewInLightMode_action",

View file

@ -45,7 +45,7 @@ export class CollapsedMailView implements Component<CollapsedMailViewAttrs> {
viewModel.isUnread() ? this.renderUnreadDot() : null, viewModel.isUnread() ? this.renderUnreadDot() : null,
viewModel.isDraftMail() ? m(".mr-4", this.renderIcon(Icons.Edit, lang.get("draft_label"))) : null, viewModel.isDraftMail() ? m(".mr-4", this.renderIcon(Icons.Edit, lang.get("draft_label"))) : null,
this.renderSender(viewModel), this.renderSender(viewModel),
m(".flex.ml-between-s.items-center", [ m(".flex.ml-between-4.items-center", [
mail.attachments.length > 0 ? this.renderIcon(Icons.Attachment, lang.get("attachment_label")) : null, mail.attachments.length > 0 ? this.renderIcon(Icons.Attachment, lang.get("attachment_label")) : null,
viewModel.isConfidential() ? this.renderIcon(getConfidentialIcon(mail), lang.get("confidential_label")) : null, viewModel.isConfidential() ? this.renderIcon(getConfidentialIcon(mail), lang.get("confidential_label")) : null,
this.renderIcon(getFolderIconByType(folderInfo.folderType), folderInfo.name), this.renderIcon(getFolderIconByType(folderInfo.folderType), folderInfo.name),

View file

@ -395,7 +395,7 @@ export class MailListView implements Component<MailListViewAttrs> {
? [ ? [
m(".flex.flex-column.plr-l", [ m(".flex.flex-column.plr-l", [
m(".small.flex-grow.pt", lang.get("storageDeletion_msg")), m(".small.flex-grow.pt", lang.get("storageDeletion_msg")),
m(".mr-negative-s.align-self-end", m(Button, purgeButtonAttrs)), m(".mr-negative-8.align-self-end", m(Button, purgeButtonAttrs)),
]), ]),
] ]
: null, : null,

View file

@ -164,12 +164,12 @@ export class MailViewerHeader implements Component<MailViewerHeaderAttrs> {
m(".flex", [ m(".flex", [
this.getRecipientEmailAddress(attrs), this.getRecipientEmailAddress(attrs),
m(".flex-grow"), m(".flex-grow"),
m(".flex.items-center.white-space-pre.ml-8.ml-between-s", { m(".flex.items-center.white-space-pre.ml-8.ml-between-4", {
// Orca refuses to read ut unless it's not focusable // Orca refuses to read ut unless it's not focusable
tabindex: TabIndex.Default, tabindex: TabIndex.Default,
"aria-label": lang.get(viewModel.isConfidential() ? "confidential_action" : "nonConfidential_action") + ", " + dateTime, "aria-label": lang.get(viewModel.isConfidential() ? "confidential_action" : "nonConfidential_action") + ", " + dateTime,
}), }),
m(".flex.ml-between-s.items-center", [ m(".flex.ml-between-4.items-center", [
viewModel.isConfidential() viewModel.isConfidential()
? m(Icon, { ? m(Icon, {
icon: getConfidentialIcon(viewModel.mail), icon: getConfidentialIcon(viewModel.mail),
@ -254,7 +254,7 @@ export class MailViewerHeader implements Component<MailViewerHeaderAttrs> {
], ],
), ),
m( m(
".flex-end.items-start.ml-between-s", ".flex-end.items-start.ml-between-4",
{ {
class: styles.isSingleColumnLayout() ? "" : "mt-4", class: styles.isSingleColumnLayout() ? "" : "mt-4",
style: { style: {
@ -425,7 +425,7 @@ export class MailViewerHeader implements Component<MailViewerHeaderAttrs> {
? [ ? [
m(".small.b", lang.get("to_label")), m(".small.b", lang.get("to_label")),
m( m(
".flex.col.mt-between-s", ".flex.col.mt-between-4",
viewModel.getToRecipients().map((recipient) => viewModel.getToRecipients().map((recipient) =>
m( m(
".flex", ".flex",
@ -880,7 +880,7 @@ export class MailViewerHeader implements Component<MailViewerHeaderAttrs> {
if (relevantRecipient) { if (relevantRecipient) {
const numberOfAllRecipients = viewModel.getNumberOfRecipients() const numberOfAllRecipients = viewModel.getNumberOfRecipients()
return m( return m(
".flex.click.small.ml-between-s.items-center", ".flex.click.small.ml-between-4.items-center",
{ {
style: { style: {
// use this to allow the container to shrink, otherwise it doesn't want to cut the recipient address // use this to allow the container to shrink, otherwise it doesn't want to cut the recipient address

View file

@ -34,7 +34,7 @@ export class MailViewerActions implements Component<MailViewerToolbarAttrs> {
view(vnode: Vnode<MailViewerToolbarAttrs>) { view(vnode: Vnode<MailViewerToolbarAttrs>) {
const singleMailActions = this.renderSingleMailActions(vnode.attrs) const singleMailActions = this.renderSingleMailActions(vnode.attrs)
return m(".flex.ml-between-s.items-center", { "data-testid": "nav:action_bar" }, [ return m(".flex.ml-between-4.items-center", { "data-testid": "nav:action_bar" }, [
singleMailActions, singleMailActions,
singleMailActions != null ? m(".nav-bar-spacer") : null, singleMailActions != null ? m(".nav-bar-spacer") : null,
this.renderActions(vnode.attrs), this.renderActions(vnode.attrs),

View file

@ -93,7 +93,7 @@ export class SearchBarOverlay implements Component<SearchBarOverlayAttrs> {
_renderProgress(state: SearchBarState): Children { _renderProgress(state: SearchBarState): Children {
return m(".flex.col.rel", [ return m(".flex.col.rel", [
m( m(
".plr-l.pt-s.pb-s.flex.items-center.flex-space-between.mr-negative-s", ".plr-l.pt-s.pb-s.flex.items-center.flex-space-between.mr-negative-8",
{ {
style: { style: {
height: px(52), height: px(52),
@ -146,7 +146,7 @@ export class SearchBarOverlay implements Component<SearchBarOverlayAttrs> {
return m(".flex.rel", [ return m(".flex.rel", [
m( m(
".plr-l.pt-s.pb-s.flex.items-center.flex-space-between.mr-negative-s", ".plr-l.pt-s.pb-s.flex.items-center.flex-space-between.mr-negative-8",
{ {
style: { style: {
height: px(52), height: px(52),

View file

@ -480,7 +480,7 @@ export class SearchView extends BaseTopLevelView implements TopLevelView<SearchV
if (searchText == null) { if (searchText == null) {
return null return null
} }
return m("div.ml-button.mt-12.small.plr-button.content-fg.mb-16", m(Card, searchText)) return m("div.ml-8.mt-12.small.plr-button.content-fg.mb-16", m(Card, searchText))
} }
oncreate(): void { oncreate(): void {

View file

@ -31,7 +31,7 @@ export class DummyTemplateListView implements Component<DummyTemplateListViewAtt
placeholder: lang.get("searchTemplates_placeholder"), placeholder: lang.get("searchTemplates_placeholder"),
} satisfies BaseSearchBarAttrs), } satisfies BaseSearchBarAttrs),
m( m(
".mr-negative-s", ".mr-negative-8",
m(IconButton, { m(IconButton, {
title: "addTemplate_label", title: "addTemplate_label",
icon: Icons.Add, icon: Icons.Add,

View file

@ -129,7 +129,7 @@ export class KnowledgeBaseListView implements UpdatableSettingsViewer {
} satisfies BaseSearchBarAttrs), } satisfies BaseSearchBarAttrs),
this.userCanEdit() this.userCanEdit()
? m( ? m(
".mr-negative-s", ".mr-negative-8",
m(IconButton, { m(IconButton, {
title: "addEntry_label", title: "addEntry_label",
icon: Icons.Add, icon: Icons.Add,

View file

@ -430,7 +430,7 @@ export class MailSettingsViewer implements UpdatableSettingsViewer {
m(TextField, { m(TextField, {
label: "emptyString_msg", label: "emptyString_msg",
// Negative upper margin to make up for no label // Negative upper margin to make up for no label
class: "mt-negative-s", class: "mt-negative-8",
value: textFieldValue, value: textFieldValue,
isReadOnly: true, isReadOnly: true,
helpLabel: () => lang.get("localDataSection_msg"), helpLabel: () => lang.get("localDataSection_msg"),

View file

@ -102,7 +102,7 @@ class TemplateEditor implements Component<TemplateEditorAttrs> {
label: "language_label", label: "language_label",
value: this.model.selectedContent() ? lang.getTranslationText(getLanguageName(this.model.selectedContent())) : "", value: this.model.selectedContent() ? lang.getTranslationText(getLanguageName(this.model.selectedContent())) : "",
injectionsRight: () => injectionsRight: () =>
m(".flex.ml-between-s", [ m(".flex.ml-between-4", [
this.model.getAddedLanguages().length > 1 ? [this.renderRemoveLangButton(), this.renderSelectLangButton()] : null, this.model.getAddedLanguages().length > 1 ? [this.renderRemoveLangButton(), this.renderSelectLangButton()] : null,
this.renderAddLangButton(), this.renderAddLangButton(),
]), ]),

View file

@ -128,7 +128,7 @@ export class TemplateListView implements UpdatableSettingsViewer {
} satisfies BaseSearchBarAttrs), } satisfies BaseSearchBarAttrs),
this.userCanEdit() this.userCanEdit()
? m( ? m(
".mr-negative-s", ".mr-negative-8",
m(IconButton, { m(IconButton, {
title: "addTemplate_label", title: "addTemplate_label",
icon: Icons.Add, icon: Icons.Add,

View file

@ -94,7 +94,7 @@ export class GroupListView implements UpdatableSettingsViewer {
placeholder: lang.get("searchMailboxes_placeholder"), placeholder: lang.get("searchMailboxes_placeholder"),
} satisfies BaseSearchBarAttrs), } satisfies BaseSearchBarAttrs),
m( m(
".mr-negative-s", ".mr-negative-8",
m(IconButton, { m(IconButton, {
title: "createSharedMailbox_label", title: "createSharedMailbox_label",
icon: Icons.Add, icon: Icons.Add,