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

Add ItemFluid component #2

Open
nikolay-borzov opened this issue Nov 1, 2017 · 1 comment
Open

Add ItemFluid component #2

nikolay-borzov opened this issue Nov 1, 2017 · 1 comment

Comments

@nikolay-borzov
Copy link

Usually grid item's width and height depends on content width and height. Therefore it would be great to have a fluid item

<template>
  <div :id="id" class="item">
    <div class="item-content item-fluid">
      <slot></slot>
    </div>
  </div>
</template>

<script>
  export default {
    name: 'item-fluid',
    props: {
      id: {
        type: [Number, String],
        default: 'item-sm'
      },
      onClick: {
        type: Function,
        default (id) {
          return null
        }
      }
    }
  }
</script>

<style scoped></style>

To make it work we should set default .item to have fluid width and height:

.item {
  ...
  width: auto;
  max-width: 100%;
  height: auto;
  ...
}
@jocodev1
Copy link
Owner

jocodev1 commented Nov 1, 2017

@nikolay-borzov This idea is good, but these styles are not this simple. If you set max-width to 100%, the tile is going to run off the screen. Theoretically, we should set the max-width to the _width property of the grid object. I'll try to come up with a solution for it.

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