Closed lubosdz closed 5 years ago
It's not necessary. You can override this class with:
Breadcrumb::widget([
'options' => [
'class' => ['widget' => 'my-breadcrumb-class']
]
])
See https://github.com/yiisoft/yii2/blob/master/framework/helpers/BaseHtml.php#L1990
Yes, it works as you suggested, thank you. So I must use following:
public $options = [
'class' => [
'widget' => '', // remove default *breadcrumb* class
'u-list-inline g-color-gray-dark-v6', // add any custom CSS
],
];
I am wondering if it was necessary to implement it in such a complicated way. It takes time to find out which class will be injected via which attribute. Separate attribute for container CSS would be more developer-friendly. Also if the widget
is empty, it should skip injecting empty value - has no effect.
Closing since @simialbi explained how to achieve it.
What steps will reproduce the problem?
Custom templates for breadcrumbs may use different container class, than currently hard-coded
breadcrumb
.What's expected?
Make CSS class name configurable - extract as a public property.
What do you get instead?
Mixed up default BS4 classes & custom template classes. Additional
Html::removeCssClass(options, 'breadcrumbs')
must be called to fix the isssue.Issue #160 .