What are the Slack Archives?
It’s a history of our time together in the Slack Community! There’s a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.
Because this space is not active, you won’t be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..
Hi I have a question about styling of components in the spryker frontend. Lets say I have a molecule
Hi I have a question about styling of components in the spryker frontend. Lets say I have a molecule that exists in two variations (for simplicity lets a button that is white or black). My understanding is that modifiers ought to be used to realize that. Further, lets say the button is used in a molecule, the molecule is used in another molecule, and so on. How do I control the styling on the top level? What is the recommendation/ best practice? One way that solves this problem is to have a data variable 'buttonModifier' in each molecule that uses the button (directly or indirectly by using a molecule that uses the button) and pass this variable further down, until it eventually can be passed to the button modifiers. However, that seems like a suboptimal solution that quickly gets out of hand with growing number of components and styles. Another way is to pass modifiers to the 'top' molecule, and then pass them as modifiers to included molecules and eventually pass them to the button. However, here the question is how do we determine the relevant modifiers for the button molecule (and avoid that twig templates are now full of logic that extracts the correct modifiers). I'm happy for all input and experiences. Thanks, Tom.
Comments
-
-
Thanks, this was kinda in the back of my head as well, that this maybe can be solved via scss. Just so that I understand correctly, by using this approach I don't pass the modifiers to the button twig template, but instead just reuse the scss for the modifier in the top molecule? I like that approach, thank you
0 -
yep, that would be it.
0
Categories
- All Categories
- 42 Getting Started & Guidelines
- 7 Getting Started in the Community
- 8 Additional Resources
- 7 Community Ideas and Feedback
- 69 Spryker News
- 899 Developer Corner
- 760 Spryker Development
- 83 Spryker Dev Environment
- 361 Spryker Releases
- 3 Oryx frontend framework
- 34 Propel ORM
- 68 Community Projects
- 3 Community Ideation Board
- 30 Hackathon
- 3 PHP Bridge
- 6 Gacela Project
- 24 Job Opportunities
- 3.2K 📜 Slack Archives
- 116 Academy
- 5 Business Users
- 370 Docker
- 551 Slack General
- 2K Help
- 75 Knowledge Sharing
- 6 Random Stuff
- 4 Code Testing
- 32 Product & Business Questions
- 68 Spryker Safari Questions
- 50 Random