Markbind: <box>: support no-* attributes

Created on 12 Jan 2020  路  10Comments  路  Source: MarkBind/markbind

Perhaps we should support no-icon no-background no-border attributes to omit the respective aspects more conveniently?

c.Enhancement f-Box p.Medium

All 10 comments

That seems fine, although we also need to consider what happens when both the positive and negative attributes appear. For example: <box icon=":rocket:" no-icon>.

Maybe if both attributes do appear together, the icon takes precedence over no-icon, since otherwise the author would not have bothered with specifying a custom icon if the intention was to not have an icon at all.

Maybe if both attributes do appear together, the icon takes precedence over no-icon, since otherwise the author would not have bothered with specifying a custom icon if the intention was to not have an icon at all.

Yes, that sounds reasonable.

Is this still under discussion? I'd like to look into this.

I'm also OK with using empty value as no-value e.g., icon="" means there is no icon. @yamgent @acjh What do you guys think?

no-icon seems to be a firmer declaration, since icon="" might also be taken to mean "use default icon". In fact, actually icon="" == icon.

no-icon no-background no-border

Are these the only attributes to consider?

I'm not sure what's useful about having a no-border.

Are these the only attributes to consider?

The only other element is the vertical bar on the left.

I'm not sure what's useful about having a no-border.

Example box with no border:

image

Example box with no border:

Ah, I understand clearly now.

The only other element is the vertical bar on the left.

Interestingly, that vertical bar on the left is just part of the border, i.e. border-left-width: 5px;

But the output box you showed above can still be acheived.

<box no-background no-border border-left-color="grey">
  content
</box>

image

Was this page helpful?
0 / 5 - 0 ratings