From d3ce18ac75ec8086b7ce56af92add0244de63d68 Mon Sep 17 00:00:00 2001 From: estrattonbailey Date: Mon, 29 Mar 2021 10:11:05 -0500 Subject: [PATCH] feat(presets): add a few handy props to the default presets --- presets.js | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/presets.js b/presets.js index 0fbd562..681999b 100644 --- a/presets.js +++ b/presets.js @@ -35,6 +35,9 @@ const shorthands = { d: { properties: ['display'] }, + pos: { + properties: ['position'] + }, top: { properties: ['top'], token: 'space', @@ -64,11 +67,6 @@ const shorthands = { properties: ['height'], unit: percOrPx }, - mw: { - properties: ['maxWidth'], - token: 'width', - unit: percOrPx - }, c: { properties: ['color'], token: 'color' @@ -90,6 +88,9 @@ const shorthands = { properties: ['order'], unit: str }, + fd: { + properties: ['flexDirection'] + }, m: { properties: ['marginTop', 'marginBottom', 'marginLeft', 'marginRight'], token: 'space', @@ -188,15 +189,16 @@ const shorthands = { } shorthands.display = shorthands.d +shorthands.position = shorthands.pos shorthands.width = shorthands.w shorthands.height = shorthands.h -shorthands.maxWidth = shorthands.mw shorthands.color = shorthands.c shorthands.background = shorthands.bg shorthands.flexWrap = shorthands.fw shorthands.alignItems = shorthands.ai shorthands.justifyContent = shorthands.jc shorthands.order = shorthands.o +shorthands.flexDirection = shorthands.fd shorthands.margin = shorthands.m shorthands.marginTop = shorthands.mt shorthands.marginBottom = shorthands.mb @@ -245,7 +247,10 @@ const macros = { h: { h: 1 }, tac: { ta: 'center' }, tar: { ta: 'right' }, - taj: { ta: 'justify' } + taj: { ta: 'justify' }, + ma: { m: 'auto' }, + mxa: { mx: 'auto' }, + mya: { my: 'auto' } } module.exports = {