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

added optgroup form examples #1108

Merged
merged 2 commits into from Jun 1, 2022
Merged

added optgroup form examples #1108

merged 2 commits into from Jun 1, 2022

Conversation

kevinpapst
Copy link
Collaborator

@kevinpapst kevinpapst commented Apr 11, 2022

@rjd22 here is a PR that adds optgroup examples in the form page, so they can be tested easily

See also #1024 and #1098

This is default browser (Safari) rendering:
Bildschirmfoto 2022-04-11 um 12 27 47

And this is how Tom-Select currently looks:
Bildschirmfoto 2022-04-11 um 12 28 41

This is how it looks normally with TomSelect and Bootstrap 5: https://tom-select.js.org/examples/optgroups/

UPDATE
I found the issue that is causing it.
You are importing the tom select bootstrap 5 css file, but you are preventing the rules from being applied. They are prefixed like this: .#{$select-ns}-dropdown where select-ns variable is ts by default, resulting in rules like these:

.ts-dropdown {
	.optgroup-header {
		font-size: $font-size-sm;
		line-height: $line-height-base;
	}
}

But the classes are not applied in the select.html include.
Is that on purpose @codecalm? By re-applying them (I did in the PR) the dropdown now looks better:
Bildschirmfoto 2022-04-11 um 12 55 08

Now dark mode still has an issue, it shows the header with white background. This rule makes it slightly better:

.ts-wrapper{
  .dropdown-menu {
    .optgroup-header {
      color: var(--#{$variable-prefix}body-color);
      background-color: var(--#{$variable-prefix}body-bg);
    }
  }
}

but I am not entirely happy with the result and would like to leave this up to you, because you simply know better.

@vercel
Copy link

vercel bot commented Apr 11, 2022

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/tabler-ui/tabler/BKXw6Dr9RHDrHcR5iS9z5rHTbxNk
✅ Preview: https://tabler-git-fork-kevinpapst-optgroup-tabler-ui.vercel.app

@@ -56,7 +65,7 @@
var el;
window.TomSelect && ({% if jekyll.environment == 'development' %}window.tabler_select["select-{{ id }}"] = {% endif %}new TomSelect(el = document.getElementById('select-{{ id }}'), {
copyClassesToDropdown: false,
dropdownClass: 'dropdown-menu',
dropdownClass: 'dropdown-menu ts-dropdown',
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

by adding this class, the original tomselect rules now will be applied

@rjd22 rjd22 requested review from codecalm and rjd22 April 11, 2022 11:57
Copy link
Collaborator

@rjd22 rjd22 left a comment

Choose a reason for hiding this comment

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

LGTM

@rjd22 rjd22 merged commit cf77c7f into tabler:main Jun 1, 2022
@kevinpapst
Copy link
Collaborator Author

Ha, I already forgot about this PR 😁

Thanks @rjd22 for merging 👍

@kevinpapst kevinpapst deleted the optgroup branch June 1, 2022 12:12
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

Successfully merging this pull request may close these issues.

None yet

2 participants