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

Implement frontend build using CFPB Design System 2.0.1 #96

Merged
merged 8 commits into from
Aug 2, 2024

Conversation

chosak
Copy link
Member

@chosak chosak commented Jul 31, 2024

This PR adds an esbuild-based frontend build to this project using the CFPB Design System release 2.0.1. The previous frontend "build" downloaded compiled CSS from consumerfinance.gov instead of building CSS itself. This broke recently when the cf.gov codebase was modified and the HTML/CSS in this project wasn't updated. The various Django templates in this project have been updated to work properly with the DS 2.0.1.

To build, you can use yarn build (or yarn watch to watch). Then run a local server with ./manage.py runserver (after creating your virtualenv and pip install -r requirements/base.txt).

URLs to check:

Note that one side effect of this change is that this project no longer uses Avenir Next, since that font is not distributed with the CFPB DS and downloading it from cf.gov/GH.com is unreliable. Pending a more formalized way to do this, this project will use Arial going forward.

This PR also adds a VSCode debug configuration for easier debugging using that editor.

Future work will involve migrating this project from Less to Sass and adopting the single CFPB DS package once it is released in cfpb/design-system#2005.

@chosak chosak changed the title Implement frontend build using CFPB Design System 2.0.0 Implement frontend build using CFPB Design System 2.0.1 Jul 31, 2024
Comment on lines 46 to 59
.u-crawl_text {
font-weight: bold;
padding-right: 5px;
margin-bottom: 15px;
}

.u-crawl_date {
display: flex;
}

.u-help_text {
margin-top: 15px;
margin-bottom: 30px;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally, these should be updated to u-crawl-text, u-crawl-date, and u-help-text, unless they are elements, in which case they should be separated by a double underscore. E.g. if u-crawl is the block, u-crawl__date would be the element.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @anselmbradford! I'm still getting used to the new naming conventions. I took a stab at this in eed3133: I made crawl-date an element (the div showing "Data last updated") and crawl-date__text its child text. The help-text element is distinct from these and is just a way to style the "Check out the Common searches page for examples". Which of these require a u- prefix -- is that only for utility mixins that are used throughout a set of pages?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Essentially yea… since we divvied a lot up into atoms (a-), molecules (m-), and organisms (o-), u- is a way to have a fourth bucket for things that don't fit as a component and are more of a one-off utility.

@chosak chosak merged commit 6fb7396 into main Aug 2, 2024
3 checks passed
@chosak chosak deleted the feature/frontend-build branch August 2, 2024 19:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants