🎉 Black Friday deal! 30% off your first year of CodyHouse Pro →

Projects

Progress value is 30%

Shared Styles

A Shared Style is a style pattern shared across multiple components. Set your custom shared styles in the 📁 custom-style/_shared-styles.scss file.


🔍 On this page:

  1. Border radius
  2. Box shadow
  3. Timing functions
  4. Shared-Styles visual editor

Border Radius #

Here's the list of radius custom properties:

:root {
  // radius
  --radius: 0.25em; // border radius base size
  --radius-sm: calc(var(--radius)/2);
  --radius-md: var(--radius);
  --radius-lg: calc(var(--radius)*2);
}

Use the radius variables to set the border-radius of your elements in CSS:

.component {
  border-radius: var(--radius-sm);
}

Alternatively, use the border-radius utility classes:

Class Description
.radius-sm border-radius: var(--radius-sm);
.radius-md border-radius: var(--radius-md);
.radius-lg border-radius: var(--radius-lg);
.radius-50% border-radius: 50%;
.radius-full border-radius: 50em;

Box Shadow #

Here's the list of shadow custom properties:

:root {
  // box shadow
  // lower depth
  --shadow-xs:  0 0.1px 0.3px rgba(0, 0, 0, 0.06),
                0 1px 2px rgba(0, 0, 0, 0.12);
  // low depth
  --shadow-sm:  0 0.3px 0.4px rgba(0, 0, 0, 0.025),
                0 0.9px 1.5px rgba(0, 0, 0, 0.05), 
                0 3.5px 6px rgba(0, 0, 0, 0.1);
  // medium depth
  --shadow-md:  0 0.9px 1.5px rgba(0, 0, 0, 0.03), 
                0 3.1px 5.5px rgba(0, 0, 0, 0.08), 
                0 14px 25px rgba(0, 0, 0, 0.12);
  // high depth
  --shadow-lg:  0 1.2px 1.9px -1px rgba(0, 0, 0, 0.014), 
                0 3.3px 5.3px -1px rgba(0, 0, 0, 0.038), 
                0 8.5px 12.7px -1px rgba(0, 0, 0, 0.085), 
                0 30px 42px -1px rgba(0, 0, 0, 0.15);
  // higher depth
  --shadow-xl:  0 1.5px 2.1px -6px rgba(0, 0, 0, 0.012), 
                0 3.6px 5.2px -6px rgba(0, 0, 0, 0.035), 
                0 7.3px 10.6px -6px rgba(0, 0, 0, 0.07), 
                0 16.2px 21.9px -6px rgba(0, 0, 0, 0.117), 
                0 46px 60px -6px rgba(0, 0, 0, 0.2);
}

Use the shadow variables to set the box-shadow value in CSS:

.component {
  box-shadow: var(--shadow-sm);
  transition: .3s;

  &:hover {
    box-shadow: var(--shadow-md);
  }
}

Alternatively, use the box-shadow utility classes:

Class Description
.shadow-xs box-shadow: var(--shadow-xs);
.shadow-sm box-shadow: var(--shadow-sm);
.shadow-md box-shadow: var(--shadow-md);
.shadow-lg box-shadow: var(--shadow-lg);
.shadow-xl box-shadow: var(--shadow-xl);

Timing Functions #

CodyFrame includes a list of custom timing functions in the 📁 base/_shared-styles.scss file:

:root {
  // timing functions
  --ease-in: cubic-bezier(0.55, 0.055, 0.675, 0.19);
  --ease-out: cubic-bezier(0.215, 0.61, 0.355, 1);
  --ease-in-out: cubic-bezier(0.645, 0.045, 0.355, 1);
  --ease-out-back: cubic-bezier(0.34, 1.56, 0.64, 1);
}

Use these custom properties to set the timing-function of your CSS animations/transitions:

.component {
  transition: transform 0.5s var(--ease-in-out);
}

Use the pen below to test the easing options:

Shared-Styles Editor #

Use the Shared-Styles Editor to create a visual library of reusable styles. Paste the generated code into the 📁 custom-style/_shared-styles.scss file of CodyFrame.

✅ Project duplicated

✅ Project created

There was an error while trying to export your project. Please try again or contact us