Coder Social home page Coder Social logo

figma-plugin-ds's People

Contributors

brianlovin avatar jackiecorn avatar jb1905 avatar nil avatar thomas-lowry avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

figma-plugin-ds's Issues

Select menu broken, if there are no options

Hey,

fantastic job on this UI toolkit for figma plugins. I just used it and I figured there is a bug with the select-menu. It fails and breaks everything after, if there are no options.

Bildschirmfoto 2019-12-30 um 18 57 10

Here is a screenshot I took from current development.

Looks like this is the affected line:

element.options[element.selectedIndex].selected = true;

as this is the only .selected occurence ;)

My workaround is, that I only add the class class="select-menu" if I know I have options to that select and run the init after.

Spinning icon is not centered correctly

When an icon (in particular the spinner) is spinning, the center of the icon has an offset that makes the animation look wrong:
Screen Recording 2020-09-09 at 11 25 19

You can see a live demo here:
https://codesandbox.io/s/vigilant-dubinsky-ywl8q?file=/index.html

It is caused by this line:

background-position: -2px -1px;

which I have no idea why it was introduced. Looks a strange declaration to me, probably should just be:

background-position: 50% 50%;

Do you think we can fix this? Happy to open a PR for this.

Publishing package to npm

Hi! I love this little DS โค๏ธ Have you considered publishing figma-plugin-ds as an npm package?

Use "currentColor" for the SVG icons fill

Do you think it would be possible to use currentColor instead of #000 for the fill of the SVG icons (or potentially just leave it empty, so it inherits the color value)? In this way it would be easier to tint the icons (instead of using CSS filters). Also, since the current fill is black anyway, this probably would have a minimal impact on the existing usage of the icons.

If it's something you would consider, let me know that I can open a PR.

Web Components?

After using your lib more often, I might have the idea, that web-components might be a good way to distribute it (at least for those components that need javascript backup). What brought me to web-components rather than using an existing FE framework:

  • It's main purpose is to be used within just html/css, figma plugin sandbox luckily doesn't come with any specific framework/library out of the box
  • In case somebody decides to use his favorite framework/library, it still can be used
  • It's the common lowest common denominator amongst all that

Have you also thought about this? What's your stance?

Texts to show default cursor on hover

Hey Tom, great work on the plugin ds!
I'm wondering if texts elements like Labels should remove the cursor change on hover, since in the native Figma UI almost all texts keeps the cursor unchanged.
What do you think?

Developer/contributing documentation?

Seems there is a lot of steps to build, minify and otherwise be able to reproduce the same files that exists here in this repository.

In order to contribute, it'd be great to be able to run these steps locally too. Currently I'm trying to figure out why the <select> element is not firing change events and was gonna use this websites examples as a base, but because I don't know/understand how this project is built, I cannot use it...

import styles from

Am I missing something? You have import styles from 'figma-plugin-ds/dist/figma-plugin-ds.css' listed in the documentation, but that file isn't a module.css file so it comes back undefined if you console.log the styles export and if you try and use it in your code with {styles.button} or something it throws caught TypeError: Cannot read properties of undefined (reading 'button')

Backward compatibility is broken?

I just checked classnames for components, and it seems not backward compatible with previous realization. For sure it looks better, because it's kind of BEM, but good to mention this in README

The menu of a <select> control doesn't refresh when it is dynamically populated with <option>

I have a select control that uses the figma-plugin-ds CSS. When I dynamically populate it with multiple option elements using JavaScript, the menu only shows the options that existed before adding them (even though in the code they are there). Is there a way to force the control to refresh?

If I use a native, non-skinned, select control I can see the dynamically added option elements.

License

The company I work for requires a licenses to use open source code. Would it be possible to add a license to this?

Thanks!

Interactive elements (like button, switch, etc) inside the disclosure are not clickable

According to the CSS declaration for .disclosure__content, the content is not clickable

pointer-events: none;

But if a user puts an interactive element (eg. a button, a switch, etc.) inside the "disclosure" component, the interactive element is not clickable. I suggest overwriting the property when the disclose is expanded:

.disclosure--expanded .disclosure__content {
    pointer-events: all;
}

(Happy to open a PR if you think is OK)

Buttons not reacting to presses correct

Seems when you press the button, it keeps it in the clicked/active state until you click on something outside of it, instead of just doing it when clicking on it.

Could try to fix this, but blocked because of #8

Start using tags & releases

Hey,

it would be great if you could tag releases and add the changes to a release so one can easily see the difference on the github releases page. ๐Ÿ‘

Getting up and running

Hi, i'm trying to get the plugin up and running. Have followed the instructions but styles are not showing up.

<link
  rel="stylesheet"
  href="./node_modules/figma-plugin-ds/dist/figma-plugin-ds.css"
/>

Disclosures not working in React UI

Hey Thomas - I can't seem to get the Disclosures to work out of the box in a React UI. Clicking on them doesn't seem to be swapping the --expanded class properly. If I add it manually in the React code it does get the correct --expanded styling, so I think the issue may be somewhere in the JS itself.

What happened to .visual-bell ?

I was using .visual-bell and its various states in the previous version of this design system and now it doesn't seem to be present? Is it called something else? Removed?

How to use this library?

Hello, sorry for posting issue. I don't understand how to use this kit. I have put <link> stylesheet in ui.html file, then I tried to make a full html page in ui.html and put these tags in <head /> then I tried to copy css from node_modules directly to ui.html and reference it as href="./css/figma-plugin-ds.css" but Figma seems to ignore any links and iframe is displayed as base64

image
This is the popup that appears with plugin

Dropdown?

Any interest in adding a dropdown list as well? Would be great to have. If someone does the same design they have in Figma, I think I could implement and submit a patch relatively quickly.

Figma Integrated Color Picker Support

I just started using this library and realized that there is no dedicated element style support for the integrated Figma color input which uses an integrated sandbox for color picking with RGB, HEX and HSB. It was quite disappointing to not find any style class for it in this repository as it is the standard for any color input in any newer Figma plugin

<div class="input">
  <input type="color" id="color1" class="colorPicker"/>
  <label for="colorPicker">Color 1</label>
</div>

Is there any possibility for the inclusion of the color input element style support in this repository in the future?

SelectMenu: cannot read property 'classList' of null

Hey! First of all, great job on making this awesome resource ๐Ÿ‘

I'm having some issues with using the Select menu component in the way it's presented on the docs. I'm importing the whole figma-plugin-ds.min.js and then running the code in the docs to initialize, i.e.:

I'm doing this

selectMenu.init({
    position: 'positionToSelection' //other options: 'under', 'overlap'
});

The markup is also the same as in the docs:

<select name="" id="select-menu1" class="select-menu">
    <option value="1" selected="selected">Item 1</option>
    <option value="2" >Item 2</option>
</select>

Then I get this error

But when I do this, figma-plugin-ds.min.js is throwing this error:

Uncaught TypeError: Cannot read property 'classList' of null

This seems easy enough to work around, but I can't help but feel like I'm doing something silly :)

Has anyone else stumbled upon this issue? Or alternatively, does someone know how to initialize it properly?

Dark mode updates?

With Figma's latest release of dark mode, any chance of this being updated to include dark mode elements/UI updates?

I suggest replacing it

parent.outerHTML = parent.innerHTML;

I suggest replacing it with because:

  1. The menu is hidden above, but you should at least display it again.
  2. replaceWith does not create new nodes, which preserves their properties.
menu.style.display = "";
parent.replaceWith(menu)

Publish to npm

It'd be great if these components (JS/CSS/SCSS/etc) were published to npm!

Missing Effect Icons

These icons are present in the Figma UI but missing from UI2 doc and the package

  • Drop Shadow
  • Layer Blur
  • Background Blur
  • Inner Blur

image

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.