Giter VIP home page Giter VIP logo

Comments (8)

shinokada avatar shinokada commented on May 26, 2024

Something like this?

It makes sense to use size for "xs" | "sm" | "md" | "lg" | "xl".

<script>
  import { twMerge } from 'tailwind-merge';
  export let size = 'md';
  export let role = 'img';
  export let ariaLabel = 'address card solid';
  const sizes = {
    xs: 'w-6 h-6',
    sm: 'w-8 h-8',
    md: 'w-10 h-10',
    lg: 'w-20 h-20',
    xl: 'w-36 h-36'
  };
</script>

<svg
  xmlns="http://www.w3.org/2000/svg"
  fill="currentColor"
  {...$$restProps}
  class={twMerge(sizes[size], $$props.class)}
  {role}
  aria-label={ariaLabel}
  viewBox="0 0 20 16"
  on:click
  on:keydown
  on:keyup
  on:focus
  on:blur
  on:mouseenter
  on:mouseleave
  on:mouseover
  on:mouseout
>
  <path
    fill="currentColor"
    d="M18 0H2a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2ZM6.5 3a2.5 2.5 0 1 1 0 5 2.5 2.5 0 0 1 0-5ZM3.014 13.021l.157-.625A3.427 3.427 0 0 1 6.5 9.571a3.426 3.426 0 0 1 3.322 2.805l.159.622-6.967.023ZM16 12h-3a1 1 0 0 1 0-2h3a1 1 0 0 1 0 2Zm0-3h-3a1 1 0 1 1 0-2h3a1 1 0 1 1 0 2Zm0-3h-3a1 1 0 1 1 0-2h3a1 1 0 1 1 0 2Z"
  />
</svg>
<script>
  import AddressCardSolid from './AddressCardSolid.svelte'
</script>

<AddressCardSolid />
<AddressCardSolid size="xs" class="text-red-500"/>
<AddressCardSolid size="sm" class="text-blue-700"/>
<AddressCardSolid size="md" />
<AddressCardSolid size="lg" />
<AddressCardSolid size="xl" />

<svelte:head>
  <link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/tailwind.min.css" />
</svelte:head>

from flowbite-svelte-icons.

shinokada avatar shinokada commented on May 26, 2024

If this is what we agree, I can update the icons.

from flowbite-svelte-icons.

jjagielka avatar jjagielka commented on May 26, 2024

Yes, that's exactly what I've meant.

One caveat though, the icons sizes must be aligned with text size so the below looks ok:

<div class="flex gap-2">
  <AddressCardSolid size="sm"><span class="text-sm">John Smiths</span>
</div>
<div class="flex gap-2">
  <AddressCardSolid size="lg"><span class="text-lg">John Smiths</span>
</div>

A task for @robert1508 ?

from flowbite-svelte-icons.

shinokada avatar shinokada commented on May 26, 2024

I just released v0.1.2. Please check it and let me know what you think.

from flowbite-svelte-icons.

jjagielka avatar jjagielka commented on May 26, 2024

I think you made them too big. After all the main usage is to insert into UI like lists, navbars, etc.
Such a huge icons as h-32 won't be used normally. Of course user can set it like that, but generally it's not a purpose of the icon to be huge.

I would propose the right column settings - REPL

from flowbite-svelte-icons.

shinokada avatar shinokada commented on May 26, 2024

I noticed that the Flowbite site uses, 2.5, 3, 3.5, 5, 6 etc.

How about these sizes?

  const sizes = {
    xs: 'w-3 h-3',
    sm: 'w-4 h-4',
    md: 'w-5 h-6',
    lg: 'w-6 h-6',
    xl: 'w-8 h-8',
   2xl: 'w-12 h-12'
  };

from flowbite-svelte-icons.

jjagielka avatar jjagielka commented on May 26, 2024

That's sounds OK but I would not add 2xl. We can stop at w-8, as we don't have the size 2xl in flowbite-svelte.

from flowbite-svelte-icons.

shinokada avatar shinokada commented on May 26, 2024

v0.2.2 is released.
I already used the class prop for Flowbite-Svette PR. I will update them in future using the size prop.

from flowbite-svelte-icons.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.