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

fix: adjust alignment for prepend/append icons #5794

Closed
wants to merge 4 commits into from

Conversation

johnleider
Copy link
Member

@johnleider johnleider commented Dec 3, 2018

Description

Motivation and Context

How Has This Been Tested?

Markup:

<template>
  <boilerplate>
    <h2>Regular</h2>
    <v-layout mb-5>
      <v-flex>
        <v-text-field
          v-model="message"
          prepend-icon="place"
          prepend-inner-icon="place"
          append-icon="place"
          append-outer-icon="place"
        ></v-text-field>
      </v-flex>
      <v-flex>
        <v-select
          v-model="message"
          prepend-icon="place"
          prepend-inner-icon="place"
          append-icon="place"
          append-outer-icon="place"
        ></v-select>
      </v-flex>
      <v-flex>
        <v-textarea
          v-model="message"
          prepend-icon="place"
          prepend-inner-icon="place"
          append-icon="place"
          append-outer-icon="place"
        ></v-textarea>
      </v-flex>
      <v-flex>
        <v-checkbox
          v-model="message"
          prepend-icon="place"
          prepend-inner-icon="place"
          append-icon="place"
          append-outer-icon="place"
        ></v-checkbox>
      </v-flex>
      <v-flex>
        <v-switch
          v-model="message"
          prepend-icon="place"
          prepend-inner-icon="place"
          append-icon="place"
          append-outer-icon="place"
        ></v-switch>
      </v-flex>
    </v-layout>
    <h2>Regular single-line</h2>
    <v-layout mb-5>
      <v-flex>
        <v-text-field
          v-model="message"
          prepend-icon="place"
          prepend-inner-icon="place"
          append-icon="place"
          append-outer-icon="place"
          single-line
        ></v-text-field>
      </v-flex>
      <v-flex>
        <v-select
          v-model="message"
          prepend-icon="place"
          prepend-inner-icon="place"
          append-icon="place"
          append-outer-icon="place"
          single-line
        ></v-select>
      </v-flex>
      <v-flex>
        <v-textarea
          v-model="message"
          prepend-icon="place"
          prepend-inner-icon="place"
          append-icon="place"
          append-outer-icon="place"
          single-line
        ></v-textarea>
      </v-flex>
      <v-flex>
        <v-checkbox
          v-model="message"
          prepend-icon="place"
          prepend-inner-icon="place"
          append-icon="place"
          append-outer-icon="place"
        ></v-checkbox>
      </v-flex>
      <v-flex>
        <v-switch
          v-model="message"
          prepend-icon="place"
          prepend-inner-icon="place"
          append-icon="place"
          append-outer-icon="place"
        ></v-switch>
      </v-flex>
    </v-layout>

    <h2>Solo</h2>
    <v-layout mb-5>
      <v-flex>
        <v-text-field
          v-model="message"
          prepend-icon="place"
          prepend-inner-icon="place"
          append-icon="place"
          append-outer-icon="place"
          solo
        ></v-text-field>
      </v-flex>
      <v-flex>
        <v-select
          v-model="message"
          prepend-icon="place"
          prepend-inner-icon="place"
          append-icon="place"
          append-outer-icon="place"
          solo
        ></v-select>
      </v-flex>
      <v-flex>
        <v-textarea
          v-model="message"
          prepend-icon="place"
          prepend-inner-icon="place"
          append-icon="place"
          append-outer-icon="place"
          solo
        ></v-textarea>
      </v-flex>
    </v-layout>

    <h2>Box</h2>
    <v-layout mb-5>
      <v-flex>
        <v-text-field
          v-model="message"
          prepend-icon="place"
          prepend-inner-icon="place"
          append-icon="place"
          append-outer-icon="place"
          box
        ></v-text-field>
      </v-flex>
      <v-flex>
        <v-select
          v-model="message"
          prepend-icon="place"
          prepend-inner-icon="place"
          append-icon="place"
          append-outer-icon="place"
          box
        ></v-select>
      </v-flex>
      <v-flex>
        <v-textarea
          v-model="message"
          prepend-icon="place"
          prepend-inner-icon="place"
          append-icon="place"
          append-outer-icon="place"
          box
        ></v-textarea>
      </v-flex>
    </v-layout>

    <h2>Box single-line</h2>
    <v-layout mb-5>
      <v-flex>
        <v-text-field
          v-model="message"
          prepend-icon="place"
          prepend-inner-icon="place"
          append-icon="place"
          append-outer-icon="place"
          box
          single-line
        ></v-text-field>
      </v-flex>
      <v-flex>
        <v-select
          v-model="message"
          prepend-icon="place"
          prepend-inner-icon="place"
          append-icon="place"
          append-outer-icon="place"
          box
          single-line
        ></v-select>
      </v-flex>
      <v-flex>
        <v-textarea
          v-model="message"
          prepend-icon="place"
          prepend-inner-icon="place"
          append-icon="place"
          append-outer-icon="place"
          box
          single-line
        ></v-textarea>
      </v-flex>
    </v-layout>

    <h2>Outline</h2>
    <v-layout mb-5>
      <v-flex>
        <v-text-field
          v-model="message"
          prepend-icon="place"
          prepend-inner-icon="place"
          append-icon="place"
          append-outer-icon="place"
          outline
        ></v-text-field>
      </v-flex>
      <v-flex>
        <v-select
          v-model="message"
          prepend-icon="place"
          prepend-inner-icon="place"
          append-icon="place"
          append-outer-icon="place"
          outline
        ></v-select>
      </v-flex>
      <v-flex>
        <v-textarea
          v-model="message"
          prepend-icon="place"
          prepend-inner-icon="place"
          append-icon="place"
          append-outer-icon="place"
          outline
        ></v-textarea>
      </v-flex>
    </v-layout>

    <h2>Outline single-line</h2>
    <v-layout mb-5>
      <v-flex>
        <v-text-field
          v-model="message"
          prepend-icon="place"
          prepend-inner-icon="place"
          append-icon="place"
          append-outer-icon="place"
          outline
          single-line
        ></v-text-field>
      </v-flex>
      <v-flex>
        <v-select
          v-model="message"
          prepend-icon="place"
          prepend-inner-icon="place"
          append-icon="place"
          append-outer-icon="place"
          outline
          single-line
        ></v-select>
      </v-flex>
      <v-flex>
        <v-textarea
          v-model="message"
          prepend-icon="place"
          prepend-inner-icon="place"
          append-icon="place"
          append-outer-icon="place"
          outline
          single-line
        ></v-textarea>
      </v-flex>
    </v-layout>

    <h2>Fullwidth</h2>
    <v-layout mb-5>
      <v-flex>
        <v-text-field
          v-model="message"
          prepend-icon="place"
          prepend-inner-icon="place"
          append-icon="place"
          append-outer-icon="place"
          full-width
        ></v-text-field>
      </v-flex>
      <v-flex>
        <v-select
          v-model="message"
          prepend-icon="place"
          prepend-inner-icon="place"
          append-icon="place"
          append-outer-icon="place"
          full-width
        ></v-select>
      </v-flex>
      <v-flex>
        <v-textarea
          v-model="message"
          prepend-icon="place"
          prepend-inner-icon="place"
          append-icon="place"
          append-outer-icon="place"
          full-width
        ></v-textarea>
      </v-flex>
    </v-layout>
    <v-layout class="mb-5">
      <v-flex>
        <v-slider
          prepend-icon="place"
          prepend-inner-icon="place"
          append-icon="place"
          append-outer-icon="place"
        ></v-slider>
      </v-flex>
    </v-layout>
    <v-layout class="mb-5">
      <v-flex>
        <v-slider
          prepend-icon="place"
          prepend-inner-icon="place"
          append-icon="place"
          append-outer-icon="place"
        ></v-slider>
      </v-flex>
    </v-layout>
    <v-layout class="mb-5">
      <v-flex>
        <v-autocomplete
          prepend-icon="place"
          prepend-inner-icon="place"
          append-icon="place"
          append-outer-icon="place"
        ></v-autocomplete>
      </v-flex>
    </v-layout>
  </boilerplate>
</template>

<script>
  export default {
    data: () => ({
      message: 'Test'
    })
  }
</script>

<style lang="stylus">
.v-input
  border: 1px dashed red

//   &__control
//     border: 1px dashed blue

//   &__slot
//     border: 1px dashed orange

// .v-text-field__slot
//   border: 1px dashed green

input,
textarea
  background-color: lightblue !important

.v-input__icon
  border: 1px dashed blue
.v-input__append-inner,
.v-input__append-outer,
.v-input__prepend-inner,
.v-input__prepend-outer
  // border: 1px solid brown
</style>

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Improvement/refactoring (non-breaking change that doesn't add any feature but make things better)

Checklist:

  • The PR title is no longer than 64 characters.
  • The PR is submitted to the correct branch (master for bug fixes and documentation updates, dev for new features and breaking changes).
  • My code follows the code style of this project.
  • I've added relevant changes to the documentation (applies to new features and breaking changes in core library)

@johnleider johnleider added T: bug Functionality that does not work as intended/expected S: work in progress labels Dec 3, 2018
@johnleider johnleider self-assigned this Dec 3, 2018
@vercel
Copy link

vercel bot commented Dec 3, 2018

This pull request is automatically deployed with Now.
To access deployments, click Details below or on the icon next to each push.

@peluprvi peluprvi mentioned this pull request Dec 3, 2018
8 tasks
@peluprvi peluprvi closed this Dec 3, 2018
@peluprvi peluprvi reopened this Dec 3, 2018
@codecov
Copy link

codecov bot commented Dec 3, 2018

Codecov Report

Merging #5794 into dev will increase coverage by 0.07%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##              dev    #5794      +/-   ##
==========================================
+ Coverage   88.56%   88.63%   +0.07%     
==========================================
  Files         281      281              
  Lines        6163     6203      +40     
  Branches     1532     1552      +20     
==========================================
+ Hits         5458     5498      +40     
  Misses        587      587              
  Partials      118      118
Impacted Files Coverage Δ
packages/vuetify/src/components/VImg/VImg.ts 99.03% <0%> (+0.6%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c3c7839...5fefe52. Read the comment docs.

@peluprvi
Copy link
Contributor

peluprvi commented Dec 4, 2018

You can try using outline instead of border in your playground to keep the size as default.

MD1 Specs:

image

For clear, voice input and dropdown, MD1 spec vertical align the icon in the middle of the box instead of the middle of the text:

image

MD2 has completely different measures, spaces, margins and paddings:

image
image

But MD2 still centralizing the clear button (and other right buttons) with the box, instead of the text:

image

@johnleider
Copy link
Member Author

Going to approach this a different direction after inputs are converted to TS starting with: #5852

@johnleider johnleider closed this Dec 10, 2018
@MajesticPotatoe MajesticPotatoe deleted the fix/#4544-input-icon-alignment branch January 15, 2019 00:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S: work in progress T: bug Functionality that does not work as intended/expected
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants