Shared Styles
A Shared Style is a style pattern shared across multiple components.
Note
The shared-style file has been deprecated in CodyFrame v4 and up
In CodyFrame v3, you can use the custom-style/_shared-styles.scss file to customize the border-radius and the box-shadow scales, or to store reusable design patterns:
:root {
// radius
--radius: 0.375em; // border radius base size
--radius-sm: calc(var(--radius)/2);
--radius-md: var(--radius);
--radius-lg: calc(var(--radius)*2);
// box shadow
--shadow-ring: 0 0 0 1px hsla(0, 0%, 0%, 0.05);
--shadow-xs: 0 0 0 1px hsla(0, 0%, 0%, 0.02),
0 1px 3px -1px hsla(0, 0%, 0%, 0.2);
--shadow-sm: 0 0.3px 0.4px hsla(0, 0%, 0%, 0.02),
0 0.9px 1.5px hsla(0, 0%, 0%, 0.045),
0 3.5px 6px hsla(0, 0%, 0%, 0.09);
--shadow-md: 0 0.9px 1.25px hsla(0, 0%, 0%, 0.025),
0 3px 5px hsla(0, 0%, 0%, 0.05),
0 12px 20px hsla(0, 0%, 0%, 0.09);
--shadow-lg: 0 1.2px 1.9px -1px hsla(0, 0%, 0%, 0.01),
0 3px 5px -1px hsla(0, 0%, 0%, 0.015),
0 8px 15px -1px hsla(0, 0%, 0%, 0.05),
0 28px 40px -1px hsla(0, 0%, 0%, 0.1);
--shadow-xl: 0 1.5px 2.1px -6px hsla(0, 0%, 0%, 0.009),
0 3.6px 5.2px -6px hsla(0, 0%, 0%, 0.0115),
0 7.3px 10.6px -6px hsla(0, 0%, 0%, 0.0125),
0 16.2px 21.9px -6px hsla(0, 0%, 0%, 0.025),
0 46px 60px -6px hsla(0, 0%, 0%, 0.15);
--inner-glow: inset 0 0 0.5px 1px hsla(0, 0%, 100%, 0.075);
--inner-glow-top: inset 0 1px 0.5px hsla(0, 0%, 100%, 0.075);
}
// reusable patterns
.hover\:reduce-opacity {
opacity: 1;
transition: all 0.3s ease;
&:hover {
opacity: 0.8;
}
}
.hover\:scale {
transition: transform 0.3s var(--ease-out-back);
&:hover {
transform: scale(1.1);
}
}
Shared-Styles Editor #
Use the shared-etyles editor to create a visual library of reusable styles. Paste the generated code into the custom-style/_shared-styles.scss file of CodyFrame v3.