Commit ca2a0935 authored by Cliff Li's avatar Cliff Li
Browse files

Refactor less files

parent af95c01b
......@@ -17,6 +17,7 @@ import jobOfferList from './views/jobs/jobofferList';
import jobOfferDetails from './views/jobs/jobofferDetails';
import companyList from './views/companies/companyList';
import companyDetail from './views/companies/companyDetail';
import './views/styles/base.less';
m.route(document.body, '/', {
'/': {
......
import m from 'mithril';
import * as events from '../models/events';
import './styles/frontpage.less';
const date = `${new Date().toISOString().split('.')[0]}Z`;
const renderCards = item => m('div', { class: 'frontpage-card' }, item);
const renderCards = item => m('div.frontpage-card', item);
const renderHotCards = (item, index) => {
if (index === 0) return m('div', { class: 'hot-first-card' }, item);
return m('div', { class: 'hot-card' }, item);
if (index === 0) return m('div.hot-first-card', item);
return m('div.hot-card', item);
};
export default class Frontpage {
......@@ -30,15 +29,11 @@ export default class Frontpage {
this.jobs = ['google', 'less than google', 'abb', 'accenture'];
}
static oninit() {
console.log('init');
}
view() {
return m('div', { class: 'container' }, [
m('div', { class: 'hot-row' }, this.hot.map((item, index) => renderHotCards(item, index))),
m('div', { class: 'frontpage-row' }, this.events.map(item => renderCards(item))),
m('div', { class: 'frontpage-row' }, this.jobs.map(item => renderCards(item))),
return m('div#frontpage-container', [
m('div.hot-row', this.hot.map((item, index) => renderHotCards(item, index))),
m('div.frontpage-row', this.events.map(item => renderCards(item))),
m('div.frontpage-row', this.jobs.map(item => renderCards(item))),
]);
}
}
@import './frontpage.less';
div {
border: solid 1px black;
}
\ No newline at end of file
@import 'base';
div .hot-row {
#frontpage-container {
.hot-row {
background-color: aqua;
}
}
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment