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

Box Shadow token alias mode should support multiple stacked shadows. #706

Closed
mihkeleidast opened this issue May 13, 2022 · 11 comments
Closed
Labels
🩵 Migrated to Featurebase Archive this issue and head to featurebase to follow 💡request Community feedback token type box shadow composite token type token value references alias

Comments

@mihkeleidast
Copy link
Contributor

mihkeleidast commented May 13, 2022

Is your feature request related to a problem? Please describe.

Currently, when changing a box shadow token to alias mode, only a single input is rendered. In that input, I can enter an alias for only a single shadow. The "add another shadow" button is enabled, but does not do anything in "alias mode". As shadows can be stacked in input mode, it would make sense that they can also be stacked in alias mode.

Describe the solution you'd like

When a box shadow token is in alias mode, the "add another shadow" button should work and add new inputs, when clicked. Each of those inputs should allow a single alias token to be specified.

Describe alternatives you've considered

  1. Not using alias mode, but that defeats the purpose of the feature altogether.
  2. Alias mode could be toggled on a single shadow value, e.g. it might be benefitial to create a stacked shadow, where one is aliased and the other is not. Not necessary for my usecase, but could be considered.

Additional context

Alias mode, allows for a single input:
image

Input mode, allows for multiple inputs:
image

Designs

Let's add a button in front of the Type selector that lets users toggle between alias mode and value mode for each of the shadow items. Clicking the button converts this part of the shadow into an alias selector, letting users pick from available shadows.

image

image

This might not be the best/most discoverable solution, but it's something that allows us to iterate on.

@leovogel
Copy link

leovogel commented May 25, 2022

+1

This is a feature I thought existed; I was about to build my shadows in this componentized way.

@danfigmatokens
Copy link

Just posted in the FT Slack asking about this thinking it was probably a bug. Would definitely love to get this in as it's how our dev team is building the shadow tokens right now and I'd like to be able to get the FT structure to match (we're not syncing with dev yet but hoping to at some point!)

@six7
Copy link
Collaborator

six7 commented Sep 1, 2022

Just posted in the FT Slack asking about this thinking it was probably a bug. Would definitely love to get this in as it's how our dev team is building the shadow tokens right now and I'd like to be able to get the FT structure to match (we're not syncing with dev yet but hoping to at some point!)

Q on this: you'd only want to reference multiple single shadow tokens that way? Or would you expect if you reference a shadow token that has 3 layers of shadows that the plugin expands that?

@mihkeleidast
Copy link
Contributor Author

Q on this: you'd only want to reference multiple single shadow tokens that way? Or would you expect if you reference a shadow token that has 3 layers of shadows that the plugin expands that?

Can you clarify the question, do you mean if FT should allow stacked shadows in either alias mode, or non-alias mode, or could these be mixed?

Just to provide some examples, our source of truth is our style-dictionary token collection in JSON, in there both "no alias", "all alias", and "mixed" would be valid, so it would be nice if FT could support the same:

{
  "shadow": {
    "elevation": {
      "alias": {
        "value": ["{shadow.core.12}", "{shadow.core.4}", "{shadow.core.2}"]
      },
      "mixed": {
        "value": [
          "{shadow.core.12}",
          "{shadow.core.4}",
          {
            "x": "0",
            "y": "1",
            "blur": "2",
            "spread": "0",
            "color": "{color.core.black.8}",
            "type": "dropShadow"
          }
        ]
      }
    }
  }
}

@danfigmatokens
Copy link

@six7 I would expect both to work, whether the reference tokens contain single or multiple shadows per token.

@six7
Copy link
Collaborator

six7 commented Sep 2, 2022

So, to clarify, both should work, correct?

{
  "shadow": {
    "core": {
      "value": {
        "x": "0",
        "y": "1",
        "blur": "2",
        "spread": "0",
        "color": "{color.core.black.8}",
        "type": "dropShadow"
      }
    },
    "alias": {
      "value": ["{shadow.core}", "{shadow.mixed}"]
    }
    "mixed": {
      "value": [
        "{shadow.core}",
        {
          "x": "0",
          "y": "1",
          "blur": "2",
          "spread": "0",
          "color": "{color.core.black.8}",
          "type": "dropShadow"
        }
      ]
    }
  }
}

with the result of shadow.alias being

[
  "{shadow.core}",
  "{shadow.core}",
  {
    "x": "0",
    "y": "1",
    "blur": "2",
    "spread": "0",
    "color": "{color.core.black.8}",
    "type": "dropShadow"
  }
]

@danfigmatokens
Copy link

danfigmatokens commented Sep 2, 2022

Exactly what I would expect I think, yep. Keeping them in the order they are applied across all and repeating any that are repeated by mixing multiple layers of reference tokens.

@six7
Copy link
Collaborator

six7 commented Sep 3, 2022

Would you want to mix aliases with regular shadows? I'm mainly thinking about keeping the UI clean here, technically it should be possible.

As in

shadow:
  [
    '{shadow.small}',
    {
      offsetX: 0,
      offsetY: 4,
      blur: 4,
      spread: 0,
      color: '#000080'
    }
  ]

@danfigmatokens
Copy link

I don't think we would ever do that. I would probably expect it to be possible theoretically, but personally for our system, no.

@six7 six7 moved this to 🔜 Next up in Tokens Studio for Figma Roadmap Dec 10, 2022
@six7 six7 moved this from 🔜 Next up to 🗃️ Backlog in Tokens Studio for Figma Roadmap Mar 11, 2023
@SamIam4Hyma SamIam4Hyma added 💡request Community feedback token type box shadow composite token type token value references alias 🩵 Migrated to Featurebase Archive this issue and head to featurebase to follow labels Mar 20, 2024
@LukeFinch
Copy link
Contributor

This request has been moved to our new feedback tool. Go check out https://tokensstudio.featurebase.app/ to create a free account. You can upvote and comment on existing posts, make a new request, and subscribe to be notified when requests move into our roadmap.

@LukeFinch LukeFinch closed this as not planned Won't fix, can't repro, duplicate, stale Apr 12, 2024
@github-project-automation github-project-automation bot moved this from 🗃️ Backlog to ✅ Done in Tokens Studio for Figma Roadmap Apr 12, 2024
@UdayHyma
Copy link
Collaborator

Here's the URL to the featurebase post that is linked to this ticket:https://tokensstudio.featurebase.app/p/enhanced-functionality-for-boxshadow-tokens-greater-effects-in-figma

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🩵 Migrated to Featurebase Archive this issue and head to featurebase to follow 💡request Community feedback token type box shadow composite token type token value references alias
Projects
Status: ✅ Done
Development

No branches or pull requests

7 participants