Skip to content

Consider Pagination parameter modifierClass to be actual modifier for the rest of Pagination class-related params #6611

Open
@LeTraceurSnork

Description

@LeTraceurSnork

Clear and concise description of the problem

Pagination module now has bunch of parameters such as paginationDisabledClass, horizontalClass, hiddenClass, etc.
But at the same time there is parameter modifierClass that semantically should be a prefix to all of them.

Suggested solution

So my suggestion is: if modifierClass is overriden, but the other params isn't, they will substitute modifierClass as their prefix, like below:

const swiper = new Swiper($slider[0], {
    modules: [Pagination],
    pagination: {
        modifierClass: 'foobar',
    },
});

And that would do the same as if you call it now as such:

const swiper = new Swiper($slider[0], {
    modules: [Pagination],
    pagination: {
        modifierClass: 'foobar',
        hiddenClass: 'foobar-hidden',
        paginationDisabledClass: 'foobar-disabled',
        ...,
        verticalClass: 'foobar-vertical'
    },
});

Alternative

No response

Additional context

No response

Validations

  • Follow our Code of Conduct
  • Read the docs.
  • Check that there isn't already an issue that request the same feature to avoid creating a duplicate.

Would you like to open a PR for this feature?

  • I'm willing to open a PR

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions