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

Re-add cfpb-atomic-component missing Less files #2007

Merged
merged 1 commit into from
Jul 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions packages/cfpb-atomic-component/src/cfpb-atomic-component.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/* ==========================================================================
Design System
Atomic component utilities
========================================================================== */

// Import utilities.
@import (less) 'utilities/transition/transition.less';
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
// Import external dependencies
@import (reference) '@cfpb/cfpb-core/src/vars.less';

/* ==========================================================================
Utility classes for transitions.

Adds transitions utilty classes for transform, opacity,
and for the removing the transition duration.
========================================================================== */

.u-no-animation {
transition-duration: 0s !important;
}

//
// Utility classes for moving an element using transform translate values.
//

.u-move-transition {
transition: transform 0.25s ease-out;
}

.u-move-to-origin {
transform: translate3d(0, 0, 0);
}

.u-move-left {
transform: translate3d(-100%, 0, 0);
}

// TODO: Look into adding a mixin for movement multiples.
.u-move-left-2x {
transform: translate3d(-200%, 0, 0);
}

.u-move-left-3x {
transform: translate3d(-300%, 0, 0);
}

.u-move-right {
transform: translate3d(100%, 0, 0);
}

.u-move-up {
transform: translate3d(0, -100%, 0);
}

//
// Utility classes for setting an element's opacity.
//

.u-alpha-transition {
transition: opacity 0.25s linear;
}

.u-alpha-100 {
opacity: 1;
}

.u-alpha-0 {
opacity: 0;
}

//
// Utility classes for setting an element's height.
//

.u-max-height-transition {
overflow: hidden;
contain: paint;

// Duration is set here, but it is actually overridden in the JavaScript.
transition: max-height 0.2s ease-out;
}

/*
.u-max-height-default {
This class is just keep for documentation completeness.
The actual max-height is set in the JavaScript,
so that we know what the actual height of the content is for easing purposes.
}
*/

.u-max-height-zero {
max-height: 0 !important;
}

.u-max-height-summary {
/* The value set here should show 4 lines of text at our standard 16px
base font size. The calculation comes from the following:
88px = 16 * 5.5em.
5.5em = base-line-height (22px) * 4 / base-font-size (16px)
*/
max-height: 88px !important;
}