diff --git a/docs/userGuide/components/advanced.md b/docs/userGuide/components/advanced.md index 7843509881..8e9a248577 100644 --- a/docs/userGuide/components/advanced.md +++ b/docs/userGuide/components/advanced.md @@ -71,6 +71,55 @@ Using the normal syntax, you are only able to use markdown formatting on heading
+**Box Slot Options:** + +Slot name | Default class | +--- | --- | +icon | depends on box's `type` attribute | + +{{ icon_example }} Override the default icon for a certain type of box. + +```html + + :fas-home: + info + +``` + + + :fas-home: + info + + +{{ icon_example }} Use pictures (or even gifs) as the icon for a box. + +```html + + + some very useful info + +``` + + + + some very useful info + + +{{ icon_example }} Use [thumbnail]({{ baseUrl }}/userGuide/usingComponents.html#thumbnails) as the icon. + + +```html + + + use thumbnail as the icon + +``` + + + + use thumbnail as the icon + + **Panel Slot Options:** Slot name | Default class | Notes --- | --- | --- diff --git a/src/lib/markbind/src/parsers/componentParser.js b/src/lib/markbind/src/parsers/componentParser.js index c9ed5eead3..06331480ac 100644 --- a/src/lib/markbind/src/parsers/componentParser.js +++ b/src/lib/markbind/src/parsers/componentParser.js @@ -356,7 +356,7 @@ function _parseBoxAttributes(node) { _warnConflictingAttributes(node, 'no-icon', ['icon']); _warnDeprecatedAttributes(node, { heading: 'header' }); - _parseAttributeWithoutOverride(node, 'icon', true, '_icon'); + _parseAttributeWithoutOverride(node, 'icon', true, 'icon'); _parseAttributeWithoutOverride(node, 'header', false, '_header'); _parseAttributeWithoutOverride(node, 'heading', false, '_header'); diff --git a/test/unit/utils/componentParserData.js b/test/unit/utils/componentParserData.js index 966e55f415..96dd33bcaf 100644 --- a/test/unit/utils/componentParserData.js +++ b/test/unit/utils/componentParserData.js @@ -241,13 +241,13 @@ module.exports.PARSE_TAB_GROUP_HEADER_EXPECTED = ` module.exports.PARSE_BOX_ICON = ` - Icon attribute should be inserted as internal _icon slot and deleted. + Icon attribute should be inserted as internal icon slot and deleted. `; module.exports.PARSE_BOX_ICON_EXPECTED = ` - - Icon attribute should be inserted as internal _icon slot and deleted. + + Icon attribute should be inserted as internal icon slot and deleted. `;