Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

transfering custom data attributes #8

Open
largo17 opened this issue Jun 28, 2023 · 1 comment
Open

transfering custom data attributes #8

largo17 opened this issue Jun 28, 2023 · 1 comment

Comments

@largo17
Copy link

largo17 commented Jun 28, 2023

Hi, i am using your plugin on one of my projects.
I used to use a styled UL with custom JS code to achieve a similar effect but I was missing accessibility and arrows to navigate the options so I am migrating to LC-select.
In my original code, I have nested options ( think of a folder subtree)... for that and in order to style, I was giving a data-indentation attribute to each li.
When using your plugin, this custom attribute is understandably, not transferred to the elements.
Is there a way to achieve this already?
Would you be interested in adding it?

Thanks in advance...

@abhinavashish15
Copy link

You can achieve custom styling by using CSS to apply indentation to your options. While LC-select might not have a direct attribute for indentation, you can use classes or other attributes to target and style your options accordingly.
For example:

.lc-select-option[data-indentation="1"]
{
padding-left: 10px;
}

.lc-select-option[data-indentation="2"]
{
padding-left: 20px;
}

** If the data-indentation attribute is a feature you believe would enhance LC-select, you could consider reaching out to the developers of the library to request such a feature or even contribute to the project by adding it yourself. **

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants