In my CMS project, the CMS team has a special requirement regarding unordered and ordered lists. They want the size of the bullet list icon to adjust according to the text content within the list.
The image below shows the default design of a list item:
https://i.sstatic.net/kiaSF.png
However, in the image below, the size of the bullet list icon remains constant even if the text inside the list has a larger font-size:
https://i.sstatic.net/rLwyS.png
https://i.sstatic.net/amTxt.png
I have attempted to fix this issue with the following code, but it did not work:
ul {
li {
position: relative;
list-style-type: none;
padding-left: 9/@rem;
&::before {
content: "\2022";
color: @primary-c1-hex1;
font-weight: bold;
display: inline-block;
width: 1em;
margin-left: -28/@em;
padding-right: 11/@em;
transform: scale(0.8);
}
>h6, >strong h6, > b h6 {
display: inline-block;
}
}
}
How can I make the size of the bullet list icons dynamic using CSS? If CSS alone is not sufficient, is there a workaround using JavaScript?