Custom props for sharing styles
Being able to define custom props gives you powerful possibilities.
In this guide, we will check how you can share/apply different styles by creating a skeleton
style
that you can apply to any UI element while your app is in a loading state.
#
1. Choose methodUsually, the approach is to create a Skeleton
component, right?! CCSS's unique approach twists this logic:
Why just not being able to apply this style on any element?! With such approach, you can apply
skeleton styles to any real and/or dummy content which will more accurately represent your final design/layout.
#
2. Create a custom propTo register custom props you need to create your own CCSS instance first. For sake of simplicity, we will
call our prop is
.
We're defining a value-map
for the property is
where the values getting resolved as a CCSS object.