Skip to content

@unovis/svelte: Fixing SingleContainer props and adding support for class property #294

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

Merged
merged 4 commits into from
Nov 1, 2023

Conversation

reb-dev
Copy link
Contributor

@reb-dev reb-dev commented Oct 24, 2023

closes: #291

Previously, $$restProps object was ignored in the initChart call, resulting in missing props. I fixed the logic and did some minor refactoring to ensure update calls weren't being called unnecessarily.

Additionally, users can now add the class property for containers.

Note: Due to the way svelte component styles are scoped, the :global modifier is required for it to take effect. It is recommended to combine local and global to avoid conflicts and keep the scope as limited as possible. For example:

<div>
    <VisSingleContainer class='chart'>...</VisSingleContainer>
</div>
<style>
    div :global(.chart) {
        /* Applies to elements in any component inside a <div>
        element belonging to this component. ✅ Recommended */
    }

    :global(.chart) {
        /* Applies to all elements in any component in the document
        where class="chart". ⛔ Works, but not recommended */
     }

    .chart {
        /* Strictly applies to elements (not components) that belong to this
        component. ❌ Doesn't work for `@unovis/svelte` containers */
    }
</style>

@reb-dev reb-dev force-pushed the fix/svelte-container-styles branch 2 times, most recently from c49ab90 to cf3efaf Compare October 31, 2023 23:00
@reb-dev reb-dev force-pushed the fix/svelte-container-styles branch 2 times, most recently from 001d085 to 98470be Compare November 1, 2023 00:12
@reb-dev reb-dev force-pushed the fix/svelte-container-styles branch from 98470be to 86ba28d Compare November 1, 2023 00:14
@rokotyan rokotyan merged commit 6c827ed into main Nov 1, 2023
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.

@unovis/svelte VisSingleContainer Props have no effect
2 participants