GithubHelp home page GithubHelp logo

lukasoppermann / elevation-scale Goto Github PK

View Code? Open in Web Editor NEW
14.0 4.0 3.0 7.32 MB

Figma plugin to create elevation systems based on functions.

TypeScript 39.54% HTML 8.20% JavaScript 38.80% CSS 13.46%
figma figma-plugins figma-plugin elevation shadow generator

elevation-scale's Introduction

Elevation Scale plugin for figma

Elevation Scale

Create shadow systems and effect styles with your choice of steps from a custom function.

Installation

  1. Go to the elevation scale plugin page
  2. Click on install in the top right corner

Usage

  1. Run the plugin and click the Create a new elevation scale button
  2. Select the elevation scale frame
  3. Adjust the settings to your liking

Changes are automatically applied and saved.

Steps

Steps are the amount of elevations/shadows you want to create. For example steps:2 will create two shadows each with all the layers you specify.

Effect Styles

To automatically create & update effect styles enable the Sync Styles option. You can optionally provide a style name that will be used to create the effect styles. If you add a # to the name it will be replaced with the current step. A ## will result in a 0 prefixed number if below 10.

// Example style name with #
Elevation / Level # // Elevation / Level 0, Elevation / Level 1, ...

// Example style name with ##
Elevation / ##dp // Elevation / 00dp, Elevation / 01dp, ..., Elevation / 12dp

If you disable Sync Styles the effect styles will be deleted as well.

Properties

  • Shadow type: Either dropshadow or innershadow
  • x: The x offset of the shadow. # is replaced by the current step. E.g. .5*#
  • y: The y offset of the shadow. # is replaced by the current step. E.g. 2+#
  • blur: The shadows blur radius. # is replaced by the current step. E.g. (1+#)*4
  • spread: The shadows spread. # is replaced by the current step. E.g. #/.5
  • color: a 6-digit hex color code between 000000 and FFFFFF
  • opacity: The opacity for the color. # is replaced by the current step. E.g. 10+# if # = 1 -> 11%

Adding Layers

An elevation step consists of one or more elevation layers (each layer is an effect e.g. a dropshadow or innershadow). Each layer you add will be present on each step. To add a new layer, click the "Add layer" button below the list of layers. To delete a layer click the trash can icon next to the layer name. (You can not delete the last layer)

Layer names are purely for your organization of the different layers and have no effect on the elevations or the names.

elevation-scale's People

Contributors

lukasoppermann avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar

elevation-scale's Issues

Copying scale creates unexpected behavior

  • style is connected
  • style name is not synced

Solution:

On copy...

  • detach styles from copied scale
  • set sync styles to false

This could potentially be achieved by adding the id of the frame to the container data and in selection checking if the id matches with the container. If not, detach styles, unset sync styles and update the id in the data.

Keyboard navigation

  • Allow user to switch fields with tab key
  • autofocus on loading the plugin
  • autofocus on selection change

Feature: Add Presets

A dropdown that allows the user to select a preset like material design elevation scale.

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.