-
Notifications
You must be signed in to change notification settings - Fork 20
Conversation
Ready for review |
src/TipBox.vue
Outdated
hasBackground() { | ||
if (this.noBackground) { | ||
return 'no-background'; | ||
} | ||
}, | ||
hasBorder() { | ||
if (this.noBorder) { | ||
return 'no-border'; | ||
} |
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.
Probably backgroundStyle
and borderStyle
are more consistent names?
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.
It would be deceiving to say these style the backgrounds and border, since that's what customStyle
does. I will rename it noBackgroundStyle
and noBorderStyle
because they enforce the styles of having no background or no border. Thanks for the heads up.
src/TipBox.vue
Outdated
@@ -1,6 +1,6 @@ | |||
<template> | |||
<div class="alert container" :class="[boxStyle, addClass, lightStyle, seamlessStyle]" :style="customStyle"> | |||
<div v-if="!isDefault" class="icon-wrapper" :class="[iconStyle]"> |
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.
@@ -167,15 +181,23 @@ | |||
return '<i class="fas fa-lightbulb"></i>'; | |||
case 'definition': | |||
return '<i class="fas fa-atlas"></i>'; | |||
default: | |||
return '<i class="fas fa-exclamation"></i>'; |
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.
Default boxes do not have icons.
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.
Looks mostly good! Just a couple of suggestions, but nothing major 🙂
} | ||
}, | ||
iconStyle() { | ||
if (this.iconSize) { | ||
return `fa-${this.iconSize}`; | ||
} | ||
return ''; | ||
}, | ||
noBackgroundStyle() { | ||
if (this.noBackground) { |
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 wonder if this will make this part less verbose:
return this.noBackground? 'no-background' : '';
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 made it consistent to the coding style of other computed properties. For example,
seamlessStyle() {
if (this.isSeamless) {
return 'seamless';
}
return '';
},
fontBlack() {
if (this.light) {
return 'font-black';
}
return '';
},
365e286
to
76b8e7f
Compare
Implement positive attribute higher priority Remove redundant icon type Update code based on comments
76b8e7f
to
3f63db9
Compare
#118 has been merged. Ready for (re)review. |
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.
Seems like there is a typo :P
src/TipBox.vue
Outdated
@@ -1,7 +1,7 @@ | |||
<template> | |||
<div class="alert box-container" :class="[boxStyle, addClass, lightStyle, seamlessStyle]" :style="customStyle"> | |||
<div class="alert box-container" :class="[boxStyle, addClass, lightStyle, seamlessStyle, , noBackgroundStyle, noBorderStyle]" :style="customStyle"> |
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's a double ,
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.
😞 Fixed.
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
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#978
Requires MarkBind/markbind#1042
Requires #118 (will wait before it gets merged)
What is the rationale for this request?
Support
no-icon
,no-background
,no-border
attributes helps to omit the respective aspects more conveniently.What changes did you make? (Give an overview)
When no-icon is absent or icon slot is filled, the icon div will be rendered.
Because it is an or statement, the presence of
icon="..."
will take precedence overno-icon
When no-background or no-border is applied,
.no-background
or a.no-border
CSS class is applied respectively. Due to the position of CSS rules, it overrides styles applied by bootstrap or by ourselves. Since customs style are applied afterwards viastyle="..."
, it is applied last. Thus any style defined bybackground
,border-color
,border-left-color
take precedence overno-background
orno-border
.Corresponding documentation in MarkBind/markbind#1042
Provide some example code that this change will affect:
You can view the syntax at https://gist.github.com/nbriannl/9369aab530e032bc93070cd8958949e3
and the corresponding output at https://nbriannl.github.io/markbind-plain-site/
Is there anything you'd like reviewers to focus on?
Proposed commit message: (wrap lines at 72 characters)
Implement no-* attributes for