Skip to content

Commit

Permalink
feat: Icon付きのバリエーションをつくってみた
Browse files Browse the repository at this point in the history
  • Loading branch information
Hidetaro7 committed Sep 3, 2021
1 parent 4dc17a1 commit 33688f7
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/tailwindcss/form.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ module.exports = plugin.withOptions(
},
},
},
{
'.input-icon': {
'font-family': "'Font Awesome 5 Free'",
fontWeight: 900,
},
},
{
"[type='checkbox'], [type='radio']": {
appearance: 'none',
Expand Down
22 changes: 22 additions & 0 deletions packages/tailwindcss/stories/Input.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,28 @@ const TextTemplate = () => {
};
export const Text = TextTemplate.bind({});

const TextIconTemplate = () => {
return `
<div class="prose">
<p>
Font Awesome 5を使った例です
</p>
<h3>Search &#xf002;</h3>
<input type="text" class="input-icon" placeholder="&#xf002; Search" />
<h3>Mail &#xf002;</h3>
<input type="email" class="input-icon" placeholder="&#xf0e0; Search" />
<h3>Search &#xf002;</h3>
<input type="text" class="input-icon" placeholder="&#xf002; Search" />
<h3>Search &#xf002;</h3>
<input type="text" class="input-icon" placeholder="&#xf002; Search" />
</div>
`;
};
export const TextIcon = TextIconTemplate.bind({});

const NumberTemplate = () => {
return `<input type="number" placeholder="0" />`;
};
Expand Down

0 comments on commit 33688f7

Please sign in to comment.