OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

How Can we resize the Chakra Select Option Width?

  • Thread starter Thread starter Shatish Desai
  • Start date Start date
S

Shatish Desai

Guest
Basically i want to resize the chakra Select box options. i found this is a SLOT badge in elements.

enter image description here

i have tried multiple option. but none of the worked

  1. first i was try with basic CSS Property,

Code:
{
    background: red;
    width: 50px;
    max-width: 50px;
}

as we can see, only color property applied.

enter image description here

  1. i also tried with :slotted. but looks like it is not working as expected.

Code:
select.\:\:slotted\(option\) {
    max-width: 50px !important;
    width: 50px !important;
    background: green;
    display:flex;
    margin:10px;
    padding:10px;
    text-overflow:ellipsis;
    color:yellow;
}

option:slotted(option){
 max-width: 50px !important;
    background: red;
}

the issue is, it is going to outside of its width enter image description here
<p>Basically i want to <strong>resize the chakra Select box options</strong>. i found this is a <code>SLOT</code> badge in elements.</p>
<p><a href="https://i.sstatic.net/v0yT4Bo7.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/v0yT4Bo7.png" alt="enter image description here" /></a></p>
<p>i have tried multiple option. but none of the worked</p>
<ol>
<li>first i was try with basic CSS Property,</li>
</ol>
<pre><code>{
background: red;
width: 50px;
max-width: 50px;
}
</code></pre>
<p>as we can see, only <code>color</code> property applied.</p>
<p><a href="https://i.sstatic.net/ykmviC40.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/ykmviC40.png" alt="enter image description here" /></a></p>
<ol start="2">
<li>i also tried with <code>:slotted</code>. but looks like it is not working as expected.</li>
</ol>
<pre><code>select.\:\:slotted\(option\) {
max-width: 50px !important;
width: 50px !important;
background: green;
display:flex;
margin:10px;
padding:10px;
text-overflow:ellipsis;
color:yellow;
}

option:slotted(option){
max-width: 50px !important;
background: red;
}

</code></pre>
<p>the issue is, it is going to outside of its width
<a href="https://i.sstatic.net/6HkXX9BM.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/6HkXX9BM.png" alt="enter image description here" /></a></p>
Continue reading...
 
Top