-
Notifications
You must be signed in to change notification settings - Fork 123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update documentation on icon slot for boxes #1123
Conversation
**Box Slot Options:** | ||
Slot name | Default class | Notes | ||
--- | --- | --- | ||
_icon | (depends on box's `type` attribute) | Example: `<i slot="_icon" class="fas fa-times"></i>` will replace the icon with a cross sign in spite of the box's type. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<i slot="_icon" class="fas fa-times"></i>
is not how I normally use the slot
technique.
I was expecting to use it like <span slot="icon" class="text-danger">:fas-home:</span>
. Would that work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice.
I suppose not easy to change to icon
instead of _icon
? If not, this is going to be the first time we expose a underscore prefixed name in the user guide.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice.
I suppose not easy to change toicon
instead of_icon
? If not, this is going to be the first time we expose a underscore prefixed name in the user guide.
Should be pretty simple. Having an underscore does not change vue's slot behaviour in anyway.
_xxx
is just the naming convention for slots we don't want to be exposed to the user MarkBind/vue-strap#120 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's use icon
then, as we are now exposing it to the users?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, are there any limitations as to what can be put in the slot? e.g., can I put a markbind thumnail or an image in the icon slot?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's use
icon
then, as we are now exposing it to the users?
Sure, will create corresponding vue-strap PR shortly.
Also, are there any limitations as to what can be put in the slot? e.g., can I put a markbind thumnail or an image in the icon slot?
There shouldn't be any limitations as it's just replacing the placeholder in the template. Just the formatting could be messed up and need manual config.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good. Can try some reasonable use cases (e.g., using thumbnails, images, small animated gifs) as icons and give them as examples in the documentation.
<img slot="icon" src="https://icons8.com/vue-static/landings/animated-icons/icons/cloud/cloud.gif"></img> | ||
some very useful info | ||
</box> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can post a screenshot? I can't see the final look from the PR preview.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the animated gif, can find one without background (or make the box background white) so that it blends in nicely? We should try to make the examples as good looking as possible.
Can also add an example using a thumbnail as an icon (i.e., using MarkBind thumbnails feature), possibly a thumbnail of a letter or a number?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes to /vue-strap looks good 👍
will need to update the name for the icon
attribute to slot transformation, and tests as well here
|
||
Slot name | Default class | | ||
--- | --- | | ||
icon | (depends on box's `type` attribute) | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could remove the brackets (
)
--- | --- | | ||
icon | (depends on box's `type` attribute) | | ||
|
||
*Example 1*: Override the default icon for a certain type of box. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could use {{ icon_example }}
to be consistent with the rest of the page here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🚀 As a heads up, this would break sites that were using the (undocumented) _icon
slot.
* 'master' of https://github.com/MarkBind/markbind: Update test files (MarkBind#1138) Remove OK button from modals (MarkBind#1134) Add start from line number functionality to code blocks (MarkBind#1115) Allow special tags to be self-closing (MarkBind#1101) Simplify baseUrl resolving process (MarkBind#1087) Remove redundant file writing (MarkBind#1090) Bump acorn from 5.7.3 to 5.7.4 (MarkBind#1121) Bump acorn from 7.1.0 to 7.1.1 in /src/lib/markbind (MarkBind#1120) Unify markdown-it parser variants (MarkBind#1056) Remove dynamic include feature (MarkBind#1037) Fix flex shrink not applying in content wrapper (MarkBind#1135) Escape Nunjucks for special tags (MarkBind#1049) Update documentation on icon slot for boxes (MarkBind#1123)
…x-pageNav * 'master' of https://github.com/MarkBind/markbind: Update test files (MarkBind#1138) Remove OK button from modals (MarkBind#1134) Add start from line number functionality to code blocks (MarkBind#1115) Allow special tags to be self-closing (MarkBind#1101) Simplify baseUrl resolving process (MarkBind#1087) Remove redundant file writing (MarkBind#1090) Bump acorn from 5.7.3 to 5.7.4 (MarkBind#1121) Bump acorn from 7.1.0 to 7.1.1 in /src/lib/markbind (MarkBind#1120) Unify markdown-it parser variants (MarkBind#1056) Remove dynamic include feature (MarkBind#1037) Fix flex shrink not applying in content wrapper (MarkBind#1135) Escape Nunjucks for special tags (MarkBind#1049) Update documentation on icon slot for boxes (MarkBind#1123) Convert code in boxes to code block (MarkBind#1086)
@le0tan perhaps this enhancement got affected by MarkBind/vue-strap#131 ? |
@damithc looks like so. As the width of the icon wrapper is fixed, it makes the slot for icon less useful - |
This issue can be fixed by making use of our Here's the box with Here's an example with multiple boxes - For @damithc 's example on using thumbnails - achievable this way - <box icon-size="2x" type="info">
<thumbnail circle slot="icon" text=":book:" background="#dff5ff" size="50"/>
thumbnail as icon
</box> We can still maintain the width of the icon-wrappers with this enhancement. |
The thumbnail should be circle. BTW, if we have to make a choice, I'd rather sacrifice fixed alignment to gain better aspect ratio. Hopefully, we can have both. |
* Update documentation on icon slot for boxes * Update the examples for using icon slot for boxes. * Resolve comments.
What is the purpose of this pull request? (put "X" next to an item, remove the rest)
• [X] Documentation update
Please replace the vue-strap file with MarkBind/vue-strap#136
Fixes #1030