Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions defaultConfig.stub.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ module.exports = {
flex: ['responsive'],
flexGrow: ['responsive'],
flexShrink: ['responsive'],
order: ['responsive'],
float: ['responsive'],
fontFamily: ['responsive'],
fontWeight: ['responsive', 'hover', 'focus'],
Expand Down
5 changes: 5 additions & 0 deletions defaultTheme.js
Original file line number Diff line number Diff line change
Expand Up @@ -322,5 +322,10 @@ module.exports = function() {
'0': 0,
default: 1,
},
order: {
first: -1,
last: 1,
none: 0,
},
}
}
2 changes: 2 additions & 0 deletions src/corePlugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import alignContent from './plugins/alignContent'
import flex from './plugins/flex'
import flexGrow from './plugins/flexGrow'
import flexShrink from './plugins/flexShrink'
import order from './plugins/order'
import float from './plugins/float'
import fontFamily from './plugins/fontFamily'
import fontWeight from './plugins/fontWeight'
Expand Down Expand Up @@ -104,6 +105,7 @@ export default function(config) {
flex,
flexGrow,
flexShrink,
order,
float,
fontFamily,
fontWeight,
Expand Down
18 changes: 18 additions & 0 deletions src/plugins/order.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import _ from 'lodash'

export default function({ values, variants }) {
return function({ addUtilities }) {
const utilities = _.fromPairs(
_.map(values, (value, modifier) => {
return [
`.order-${modifier}`,
{
'order': value,
},
]
})
)

addUtilities(utilities, variants)
}
}