Skip to content
This repository has been archived by the owner on Jul 12, 2020. It is now read-only.

Support custom boxes #26

Merged
merged 6 commits into from
May 24, 2018
Merged

Support custom boxes #26

merged 6 commits into from
May 24, 2018

Conversation

yamgent
Copy link
Member

@yamgent yamgent commented May 18, 2018

What is the purpose of this pull request? (put "X" next to an item, remove the rest)

• [X] Enhancement to an existing feature

Fixes MarkBind/markbind#69
Fixes MarkBind/markbind#62

What is the rationale for this request?

  • User wants a way to customize tip-boxes with custom colors and icons.
  • User wants an empty-fill type tip boxes.
  • User wants an alias for tip-box. (You can use box instead of tip-box).

What changes did you make? (Give an overview)

Added new attributes color, background-color, icon, border-color for tip-box customization. Also added a new attribute border-left-color to support empty-fill type tip boxes.

Provide some example code that this change will affect:

<tip-box type="info" icon=":rocket:">
    info but with rocket
</tip-box>
<tip-box type="info" color="white" background-color="red">
    info but with different colors
</tip-box>

<!-- Using box instead of tip-box -->
<box color="white" background-color="blue" border-color="darkblue">
    default with custom colors
</box>         

<!-- Empty-fill type tip boxes -->   
<box background-color="white" border-color="grey" border-left-color="blue">
    empty box with left border
</box>

Is there anything you'd like reviewers to focus on?

Documentation wordings.

Testing instructions:

The documentation provides the code under the tip-box section, can use that web page to experiment with the new attributes shown in the documentation.

@@ -1,5 +1,6 @@
<template>
<doc-section id="tipBoxDocs" name="TipBox">
<p>Alternative alias: box</p>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Alias" is sufficient.

</tip-box>
<box background-color="white" border-color="grey" border-left-color="blue">
empty box with left border
</box>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Let's move these into a separate <div class="bs-example"></div><doc-code></doc-code> group.
    At the moment, we need to scroll to see the doc-code.
  • Two examples are sufficient: empty box (demo colours), info rocket (demo icon)
  • Both can use <box>.
  • Customise type=default before type=info.
  • Be descriptive:
    • empty box with left border should be default, styled as empty box with blue left border,
    • info but with rocket should be info, with rocket icon,

</doc-code>
<doc-table name="TipBox Options">
<div>
<p>backgroundColor</p>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

background-color (similar for others)

</div>
<div>
<p>type</p>
<p><code>String</code>, one of <code>warning</code>, <code>info</code>, <code>definition</code>, <code>success</code>, <code>tip</code>, <code>important</code>, <code>wrong</code>, or empty for default.</p>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Use the same order as examples ("or empty for default." can remain at the end).
  • Considering the length, let's move this to Description (as done in Panel Options).

<p>borderLeftColor</p>
<p><code>String</code></p>
<p><code>null</code></p>
<p>Color of the left border.</p>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leave description blank unless it adds value.

  • Change this to "Overrides `border-color` for the left border."
  • Also keep for color.

@yamgent
Copy link
Member Author

yamgent commented May 21, 2018

@acjh thanks for the reviews!

info, with rocket icon
</box>
</doc-code>
<doc-table name="TipBox Options">
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just "TipBox", otherwise it becomes "TipBox Options Options".

<p>border-left-color</p>
<p><code>String</code></p>
<p><code>null</code></p>
<p>Overrides `border-color` for the left border.</p>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be <code>border-color</code>.
But let's just remove the backticks, to be consistent with Panel Option's "no-switch" reference.

@@ -52,6 +53,60 @@
definition
</tip-box>
</doc-code>
<div class="bs-example">
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a heading:

<br>
<h4>Custom boxes</h4>

@yamgent yamgent force-pushed the 69-custom-boxes branch from 782d0f9 to b9f993a Compare May 21, 2018 23:55
@yamgent
Copy link
Member Author

yamgent commented May 21, 2018

Changes made.

src/index.js Outdated
@@ -30,6 +31,7 @@ const components = {
accordion,
affix,
aside,
box,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does box: tipBox à la tabs: tabSet work?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yamgent In case you missed this.

@acjh acjh merged commit cb829fe into MarkBind:master May 24, 2018
@acjh acjh added this to the v1.1.37-markbind.8 milestone May 24, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support custom boxes Support an empty-fill type tip boxes
2 participants