Skip to content
Closed
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
2 changes: 2 additions & 0 deletions src/corePlugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ import outline from './plugins/outline'
import overflow from './plugins/overflow'
import padding from './plugins/padding'
import placeholderColor from './plugins/placeholderColor'
import placeholderPosition from './plugins/placeholderPosition'
import pointerEvents from './plugins/pointerEvents'
import position from './plugins/position'
import inset from './plugins/inset'
Expand Down Expand Up @@ -116,6 +117,7 @@ export default function({ corePlugins: corePluginConfig }) {
overflow,
padding,
placeholderColor,
placeholderPosition,
pointerEvents,
position,
inset,
Expand Down
3 changes: 3 additions & 0 deletions src/plugins/display.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ export default function() {
'.table-cell': {
display: 'table-cell',
},
'.contents': {
display: 'contents',
},
'.hidden': {
display: 'none',
},
Expand Down
19 changes: 19 additions & 0 deletions src/plugins/placeholderPosition.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import _ from 'lodash'
import flattenColorPalette from '../util/flattenColorPalette'

export default function() {
return function({ addUtilities, e, theme, variants }) {
const utilities = _.fromPairs(
_.map(flattenColorPalette(theme('placeholderPosition')), (value, modifier) => {
return [
`.${e(`placeholder-${modifier}`)}::placeholder`,
{
'text-align': value,
},
]
})
)

addUtilities(utilities, variants('placeholderPosition'))
}
}
6 changes: 6 additions & 0 deletions stubs/defaultConfig.stub.js
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,11 @@ module.exports = {
},
padding: theme => theme('spacing'),
placeholderColor: theme => theme('colors'),
placeholderPosition: {
center: 'center',
left: 'left',
right: 'right',
},
stroke: {
current: 'currentColor',
},
Expand Down Expand Up @@ -469,6 +474,7 @@ module.exports = {
overflow: ['responsive'],
padding: ['responsive'],
placeholderColor: ['responsive', 'focus'],
placeholderPosition: ['responsive'],
pointerEvents: ['responsive'],
position: ['responsive'],
resize: ['responsive'],
Expand Down