Last active
September 11, 2019 09:46
-
-
Save jacobgraf/7b54b56488c07a44e069057b8e61ff24 to your computer and use it in GitHub Desktop.
Tailwind Custom Forms - PHPStorm Live Templates
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<templateSet group="Tailwind Custom Forms"> | |
<template name="twf-input" value="<label class="block"> <span class="text-gray-700">$TITLE$</span> <input type="$TYPE$" name="$NAME$" class="form-input mt-1 block w-full" placeholder="$TITLE$"> </label>" description="Input" toReformat="false" toShortenFQNames="true"> | |
<variable name="TITLE" expression=""Input"" defaultValue="" alwaysStopAt="true" /> | |
<variable name="TYPE" expression=""text"" defaultValue="" alwaysStopAt="true" /> | |
<variable name="NAME" expression="camelCase(TITLE)" defaultValue="" alwaysStopAt="false" /> | |
<context> | |
<option name="OTHER" value="true" /> | |
</context> | |
</template> | |
<template name="twf-textarea" value="<label class="block"> <span class="text-gray-700">$TITLE$</span> <textarea name="$NAME$" class="form-textarea mt-1 block w-full" rows="$ROWS$" placeholder="$TITLE$"></textarea> </label>" description="Textarea" toReformat="false" toShortenFQNames="true"> | |
<variable name="TITLE" expression=""Textarea"" defaultValue="" alwaysStopAt="true" /> | |
<variable name="NAME" expression="camelCase(TITLE)" defaultValue="" alwaysStopAt="false" /> | |
<variable name="ROWS" expression=""3"" defaultValue="" alwaysStopAt="true" /> | |
<context> | |
<option name="OTHER" value="true" /> | |
</context> | |
</template> | |
<template name="twf-select" value="<label class="block"> <span class="text-gray-700">$TITLE$</span> <select name="$NAME$" class="form-select block w-full mt-1"> <option>$OPTION1$</option> <option>$OPTION2$</option> </select> </label>" description="Select" toReformat="false" toShortenFQNames="true"> | |
<variable name="TITLE" expression=""Select"" defaultValue="" alwaysStopAt="true" /> | |
<variable name="NAME" expression="camelCase(TITLE)" defaultValue="" alwaysStopAt="false" /> | |
<variable name="OPTION1" expression=""Option 1"" defaultValue="" alwaysStopAt="true" /> | |
<variable name="OPTION2" expression=""Option 2"" defaultValue="" alwaysStopAt="true" /> | |
<context> | |
<option name="OTHER" value="true" /> | |
</context> | |
</template> | |
<template name="twf-select-multi" value="<label class="block"> <span class="text-gray-700">$TITLE$</span> <select name="$NAME$" class="form-multiselect block w-full mt-1" multiple> <option>$OPTION1$</option> <option>$OPTION2$</option> <option>$OPTION3$</option> <option>$OPTION4$</option> <option>$OPTION5$</option> </select> </label>" description="Select (Multi)" toReformat="false" toShortenFQNames="true"> | |
<variable name="TITLE" expression=""Multiselect"" defaultValue="" alwaysStopAt="true" /> | |
<variable name="NAME" expression="camelCase(TITLE)" defaultValue="" alwaysStopAt="false" /> | |
<variable name="OPTION1" expression=""Option 1"" defaultValue="" alwaysStopAt="true" /> | |
<variable name="OPTION2" expression=""Option 2"" defaultValue="" alwaysStopAt="true" /> | |
<variable name="OPTION3" expression=""Option 3"" defaultValue="" alwaysStopAt="true" /> | |
<variable name="OPTION4" expression=""Option 4"" defaultValue="" alwaysStopAt="true" /> | |
<variable name="OPTION5" expression=""Option 5"" defaultValue="" alwaysStopAt="true" /> | |
<context> | |
<option name="OTHER" value="true" /> | |
</context> | |
</template> | |
<template name="twf-checkbox" value="<div class="block"> <span class="text-gray-700">$TITLE$</span> <div class="mt-2"> <div> <label class="inline-flex items-center"> <input name="$NAME1$" type="checkbox" class="form-checkbox" checked> <span class="ml-2">$OPTION1$</span> </label> </div> <div> <label class="inline-flex items-center"> <input name="$NAME2$" type="checkbox" class="form-checkbox"> <span class="ml-2">$OPTION2$</span> </label> </div> <div> <label class="inline-flex items-center"> <input name="$NAME3$" type="checkbox" class="form-checkbox"> <span class="ml-2">$OPTION3$</span> </label> </div> </div> </div>" description="Checkbox" toReformat="false" toShortenFQNames="true"> | |
<variable name="TITLE" expression=""Checkbox"" defaultValue="" alwaysStopAt="true" /> | |
<variable name="OPTION1" expression=""Option 1"" defaultValue="" alwaysStopAt="true" /> | |
<variable name="NAME1" expression="camelCase(OPTION1)" defaultValue="" alwaysStopAt="false" /> | |
<variable name="OPTION2" expression=""Option 2"" defaultValue="" alwaysStopAt="true" /> | |
<variable name="NAME2" expression="camelCase(OPTION2)" defaultValue="" alwaysStopAt="false" /> | |
<variable name="OPTION3" expression=""Option 3"" defaultValue="" alwaysStopAt="true" /> | |
<variable name="NAME3" expression="camelCase(OPTION3)" defaultValue="" alwaysStopAt="false" /> | |
<context> | |
<option name="OTHER" value="true" /> | |
</context> | |
</template> | |
<template name="twf-radio-buttons" value="<div class="block"> <span class="text-gray-700">$TITLE$</span> <div class="mt-2"> <div> <label class="inline-flex items-center"> <input name="$NAME1$"type="radio" class="form-radio" name="radio" value="1" checked> <span class="ml-2">$OPTION1$</span> </label> </div> <div> <label class="inline-flex items-center"> <input name="$NAME2$" type="radio" class="form-radio" name="radio" value="2"> <span class="ml-2">$OPTION2$</span> </label> </div> <div> <label class="inline-flex items-center"> <input name="$NAME3$" type="radio" class="form-radio" name="radio" value="3"> <span class="ml-2">$OPTION3$</span> </label> </div> </div> </div>" description="Radio Buttons" toReformat="false" toShortenFQNames="true"> | |
<variable name="TITLE" expression=""Radio Buttons"" defaultValue="" alwaysStopAt="true" /> | |
<variable name="OPTION1" expression=""Option 1"" defaultValue="" alwaysStopAt="true" /> | |
<variable name="NAME1" expression="camelCase(OPTION1)" defaultValue="" alwaysStopAt="false" /> | |
<variable name="OPTION2" expression=""Option 2"" defaultValue="" alwaysStopAt="true" /> | |
<variable name="NAME2" expression="camelCase(OPTION2)" defaultValue="" alwaysStopAt="false" /> | |
<variable name="OPTION3" expression=""Option 3"" defaultValue="" alwaysStopAt="true" /> | |
<variable name="NAME3" expression="camelCase(OPTION3)" defaultValue="" alwaysStopAt="false" /> | |
<context> | |
<option name="OTHER" value="true" /> | |
</context> | |
</template> | |
<template name="twf-submit" value="<input type="submit" value="$TITLE$" name="$NAME$" class="bg-green-500 hover:bg-green-700 text-white font-bold py-2 px-4 rounded cursor-pointer">" description="Submit" toReformat="false" toShortenFQNames="true"> | |
<variable name="TITLE" expression=""Submit"" defaultValue="" alwaysStopAt="true" /> | |
<variable name="NAME" expression="camelCase(TITLE)" defaultValue="" alwaysStopAt="false" /> | |
<context> | |
<option name="OTHER" value="true" /> | |
</context> | |
</template> | |
</templateSet> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment