mirror of
https://github.com/flarum/framework.git
synced 2025-05-22 14:49:57 +08:00
Major CSS revamp
- Get rid of Bootstrap (except we still rely on some JS) - Use BEM class names - Rework variables/theme config - Fix various bugs, including some on mobile The CSS is still not ideal – it needs to be cleaned up some more. But that can be a focus for after beta.
This commit is contained in:
@ -9,7 +9,7 @@ import extract from 'flarum/utils/extract';
|
||||
* A badge may have the following special props:
|
||||
*
|
||||
* - `type` The type of badge this is. This will be used to give the badge a
|
||||
* class name of `badge-{type}`.
|
||||
* class name of `Badge--{type}`.
|
||||
* - `icon` The name of an icon to show inside the badge.
|
||||
*
|
||||
* All other props will be assigned as attributes on the badge element.
|
||||
@ -20,7 +20,8 @@ export default class Badge extends Component {
|
||||
const type = extract(attrs, 'type');
|
||||
const iconName = extract(attrs, 'icon');
|
||||
|
||||
attrs.className = 'badge badge-' + type + ' ' + (attrs.className || '');
|
||||
attrs.className = 'Badge Badge--' + type + ' ' + (attrs.className || '');
|
||||
attrs.title = extract(attrs, 'label');
|
||||
|
||||
// Give the badge a unique key so that when badges are displayed together,
|
||||
// and then one is added/removed, Mithril will correctly redraw the series
|
||||
@ -29,7 +30,7 @@ export default class Badge extends Component {
|
||||
|
||||
return (
|
||||
<span {...attrs}>
|
||||
{iconName ? icon(iconName, {className: 'icon'}) : ''}
|
||||
{iconName ? icon(iconName, {className: 'Badge-icon'}) : ''}
|
||||
</span>
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user