mirror of
https://github.com/flarum/core.git
synced 2025-07-28 12:10:51 +02: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:
@@ -1,4 +1,5 @@
|
||||
import Separator from 'flarum/components/Separator';
|
||||
import classList from 'flarum/utils/classList';
|
||||
|
||||
function isSeparator(item) {
|
||||
return item && item.component === Separator;
|
||||
@@ -28,10 +29,20 @@ function withoutUnnecessarySeparators(items) {
|
||||
export default function listItems(items) {
|
||||
return withoutUnnecessarySeparators(items).map(item => {
|
||||
const isListItem = item.component && item.component.isListItem;
|
||||
const active = item.component && item.component.isActive && item.component.isActive(item.props);
|
||||
const className = item.props ? item.props.itemClassName : item.itemClassName;
|
||||
|
||||
return isListItem
|
||||
? item
|
||||
: <li className={(item.itemName ? 'item-' + item.itemName : '') + ' ' + (className || '')}>{item}</li>;
|
||||
return [
|
||||
isListItem
|
||||
? item
|
||||
: <li className={classList([
|
||||
(item.itemName ? 'item-' + item.itemName : ''),
|
||||
className,
|
||||
(active ? 'active' : '')
|
||||
])}>
|
||||
{item}
|
||||
</li>,
|
||||
' '
|
||||
];
|
||||
});
|
||||
};
|
||||
}
|
||||
|
Reference in New Issue
Block a user