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

[3] USWDS Design System #44

Merged
merged 15 commits into from
Jul 24, 2024
Merged
Show file tree
Hide file tree
Changes from 4 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 .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,10 @@

# Ignore master key for decrypting credentials and more.
/config/master.key

node_modules
stonefilipczak marked this conversation as resolved.
Show resolved Hide resolved

/app/assets/builds/*
!/app/assets/builds/.keep

/node_modules
1 change: 1 addition & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ruby 3.2.2
5 changes: 5 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,8 @@ group :test do
gem "capybara"
gem "selenium-webdriver"
end

gem "cssbundling-rails", "~> 1.4"

# Use Sass to process CSS
gem "sassc-rails"
17 changes: 17 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,17 @@ GEM
concurrent-ruby (1.3.3)
connection_pool (2.4.1)
crass (1.0.6)
cssbundling-rails (1.4.0)
railties (>= 6.0.0)
date (3.3.4)
debug (1.9.2)
irb (~> 1.10)
reline (>= 0.3.8)
drb (2.2.1)
erubi (1.13.0)
ffi (1.17.0-aarch64-linux-gnu)
ffi (1.17.0-arm64-darwin)
ffi (1.17.0-x86_64-linux-gnu)
globalid (1.2.1)
activesupport (>= 6.1)
i18n (1.14.5)
Expand Down Expand Up @@ -198,6 +203,14 @@ GEM
rexml (3.3.0)
strscan
rubyzip (2.3.2)
sassc (2.4.0)
ffi (~> 1.9)
sassc-rails (2.1.2)
railties (>= 4.0.0)
sassc (>= 2.0)
sprockets (> 3.0)
sprockets-rails
tilt
selenium-webdriver (4.21.1)
base64 (~> 0.2)
rexml (~> 3.2, >= 3.2.5)
Expand All @@ -218,6 +231,7 @@ GEM
stringio (3.1.1)
strscan (3.1.0)
thor (1.3.1)
tilt (2.3.0)
timeout (0.4.1)
turbo-rails (2.0.5)
actionpack (>= 6.0.0)
Expand All @@ -241,17 +255,20 @@ GEM

PLATFORMS
aarch64-linux
arm64-darwin-21
arm64-darwin-22
x86_64-linux

DEPENDENCIES
bootsnap
capybara
cssbundling-rails (~> 1.4)
debug
importmap-rails
jbuilder
puma (>= 5.0)
rails (~> 7.1.3, >= 7.1.3.4)
sassc-rails
selenium-webdriver
sprockets-rails
sqlite3 (~> 1.4)
Expand Down
2 changes: 2 additions & 0 deletions Procfile.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
web: env RUBY_DEBUG_OPEN=true bin/rails server
css: yarn build:css --watch
Empty file added app/assets/builds/.keep
Empty file.
7 changes: 7 additions & 0 deletions app/assets/config/manifest.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
//= link_tree ../images
//= link_tree ../builds
//= link_tree ../uswds

//= link_directory ../stylesheets .css
//= link application.sass.scss
//= link application.css
//= link application.js
//= link_tree ../../javascript .js
1 change: 1 addition & 0 deletions app/assets/stylesheets/application.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@
*= require_tree .
*= require_self
*/

13 changes: 13 additions & 0 deletions app/assets/stylesheets/application.sass.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// @use "uswds-core" as *;
@use "uswds-core" with (
$theme-font-path: "../sploing",
$theme-image-path: "../spling",
);

// Entry point for your Sass build
// 1. Load your project's USWDS settings configuration
@forward "../app/assets/uswds/_uswds-theme.scss";


// // 2. Load USWDS source code
@forward "../node_modules/@uswds/uswds/packages/uswds/_index.scss";
4 changes: 4 additions & 0 deletions app/assets/stylesheets/styles.css

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions app/assets/stylesheets/styles.css.map

Large diffs are not rendered by default.

23 changes: 23 additions & 0 deletions app/assets/uswds/_uswds-theme-custom-styles.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
* * * * * ==============================
* * * * * ==============================
* * * * * ==============================
* * * * * ==============================
========================================
========================================
========================================
----------------------------------------
USWDS THEME CUSTOM STYLES
----------------------------------------
!! Copy this file to your project's
sass root. Don't edit the version
in node_modules.
----------------------------------------
Custom project SASS goes here.

i.e.
@include u-padding-right('05');
----------------------------------------
*/

@use "uswds-core" as *;
15 changes: 15 additions & 0 deletions app/assets/uswds/_uswds-theme.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/*
----------------------------------------
USWDS with settings overrides
----------------------------------------
Uncomment the following lines and add a list of changed settings
in the form $setting: value,
----------------------------------------
*/

//
// @use "uswds-core" with (
// $theme-font-path: "../fonts",
// $theme-image-path: "../img",
// );
//
3 changes: 3 additions & 0 deletions app/assets/uswds/styles.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@forward "uswds-theme";
@forward "uswds";
@forward "uswds-theme-custom-styles";
4 changes: 4 additions & 0 deletions app/controllers/sandbox_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
class SandboxController < ApplicationController
def index
end
end
3 changes: 3 additions & 0 deletions app/javascript/application.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
console.log("tweet")
stonefilipczak marked this conversation as resolved.
Show resolved Hide resolved
// import "uswds/uswds-init"
// import "./uswds/uswds"
24 changes: 24 additions & 0 deletions app/javascript/uswds/uswds-init.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/* eslint-disable no-var */
(function uswdsInit() {
"use strict";

var loadingClass = "usa-js-loading";
var fallback;

document.documentElement.classList.add(loadingClass);
function revertClass() {
document.documentElement.classList.remove(loadingClass);
}

fallback = setTimeout(revertClass, 8000);

function verifyLoaded() {
if (window.uswdsPresent) {
clearTimeout(fallback);
revertClass();
window.removeEventListener("load", verifyLoaded, true);
}
}

window.addEventListener("load", verifyLoaded, true);
})();
2 changes: 2 additions & 0 deletions app/javascript/uswds/uswds-init.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions app/javascript/uswds/uswds-init.min.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading