Skip to content

Prefixed class names #19

@alvarotrigo

Description

@alvarotrigo

Great library!
Just one thing, it would be great to have prefixed class names.

Instead of item, which can be quite common in any page, use flex-item.

And yep, I know you can customize it using the container option, but takes a bit to figure out we also have to add the following styles added by default in flexImages.

.flex-item img{
    display: block;
    width: auto;
    height: 100%;
}
.flex-item { float: left; margin: 4px; border: 1px solid #eee; box-sizing: content-box; overflow: hidden; position: relative;  }

Another option is to use an internal class name but still making the class name configurable.
Something like...

// within the library code 
function addInternalSelector(){
    //with a configurable `container` variable
    $(container).addClass('flex-image');
}

Then, even when the user modifies the selector your CSS class will still be applied:

<img class="myCustomSelector flex-image" />
.flex-item img{
    display: block;
    width: auto;
    height: 100%;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions