Skip to content

Commit

Permalink
Remove chevron for selects with a non-default size (#137)
Browse files Browse the repository at this point in the history
* Remove chevron for selects with a non-default size

* wip

* wip

* wip

* update

* Only target `size` fix for select elements

* Swap attribute and element

They have different specificity

* Update changelog
  • Loading branch information
thecrypticace committed May 12, 2023
1 parent 615a228 commit 73d5b01
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 3 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

- Nothing yet!
### Fixed

- Remove chevron for selects with a non-default size ([#137](https://github.com/tailwindlabs/tailwindcss-forms/pull/137))

## [0.5.3] - 2022-09-02

Expand Down
20 changes: 20 additions & 0 deletions kitchen-sink.html
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,16 @@ <h2 class="text-2xl font-bold">Reset styles</h2>
<option>Option 2</option>
</select>
</label>
<label class="block">
<span class="text-gray-700">Select (single, with size)</span>
<select class="form-select block w-full mt-1" size="3">
<option>Option 1</option>
<option>Option 2</option>
<option>Option 3</option>
<option>Option 4</option>
<option>Option 5</option>
</select>
</label>
<label class="block">
<span class="text-gray-700">Select (multiple)</span>
<select class="form-multiselect block w-full mt-1" multiple>
Expand All @@ -112,6 +122,16 @@ <h2 class="text-2xl font-bold">Reset styles</h2>
<option>Option 5</option>
</select>
</label>
<label class="block">
<span class="text-gray-700">Select (multiple, with size)</span>
<select class="form-multiselect block w-full mt-1" multiple size="3">
<option>Option 1</option>
<option>Option 2</option>
<option>Option 3</option>
<option>Option 4</option>
<option>Option 5</option>
</select>
</label>
<label class="block">
<span class="text-gray-700">Textarea</span>
<textarea
Expand Down
4 changes: 2 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@ const forms = plugin.withOptions(function (options = { strategy: undefined }) {
},
},
{
base: ['[multiple]'],
class: null,
base: ['[multiple]', '[size]:where(select:not([size="1"]))'],
class: ['.form-select:where([size]:not([size="1"]))'],
styles: {
'background-image': 'initial',
'background-position': 'initial',
Expand Down

1 comment on commit 73d5b01

@vercel
Copy link

@vercel vercel bot commented on 73d5b01 May 12, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.