Skip to content

Commit

Permalink
Use ccs frontend for the shared assets
Browse files Browse the repository at this point in the history
  • Loading branch information
tim-s-ccs committed Jun 10, 2024
1 parent ca6c917 commit 9db8e26
Show file tree
Hide file tree
Showing 30 changed files with 110 additions and 638 deletions.
64 changes: 64 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,80 @@ updates:
schedule:
interval: "weekly"
day: "sunday"

# Group packages into shared PR
groups:
rails:
patterns:
- 'rails'
- 'action*'
- 'active*'

rubocop:
patterns:
- 'rubocop'
- 'rubocop-*'

feature_tests:
patterns:
- 'selenium-webdriver'
- 'cucumber-rails'
- 'database_cleaner'
- 'site_prism'
- 'axe-core-*'

- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "weekly"
day: "sunday"

# Group packages into shared PR
groups:
rails:
patterns:
- '@rails/*'
- 'turbolinks'
- 'turbolinks*'
- '@types/rails__ujs'
- '@types/turbolinks'

lint:
patterns:
- 'eslint'
- 'eslint-*'
- '@eslint/*'
- 'stylelint'
- 'stylelint-*'
- '@stylistic/*'
- 'typescript-eslint'
- '@types/eslint__js'

scss:
patterns:
- 'sass'
- 'cssnano'
- 'cssnano-*'
- 'postcss'
- 'postcss-*'

rollup:
patterns:
- '@rollup/*'
- 'rollup'
- 'rollup-*'

frontend:
patterns:
- 'ccs-frontend'
- 'govuk-frontend'

- package-ecosystem: "docker"
directory: "/"
schedule:
interval: "weekly"
day: "sunday"

- package-ecosystem: "github-actions"
directory: "/"
schedule:
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ gem 'asset_sync', '>= 2.19.1'
gem 'fog-aws', '>= 3.14.0'

# Use CCS Frontend Helpers
gem 'ccs-frontend_helpers', '~> 0.4.0'
gem 'ccs-frontend_helpers', '~> 1.0.0'

group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
Expand Down
4 changes: 2 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ GEM
caxlsx_rails (0.6.3)
actionpack (>= 3.1)
caxlsx (>= 3.0)
ccs-frontend_helpers (0.4.0)
ccs-frontend_helpers (1.0.0)
rails (>= 6.0)
clamby (1.6.8)
cliver (0.3.2)
Expand Down Expand Up @@ -669,7 +669,7 @@ DEPENDENCIES
caracal-rails (>= 1.0.2)
caxlsx (>= 3.2.0)
caxlsx_rails (>= 0.6.3)
ccs-frontend_helpers (~> 0.4.0)
ccs-frontend_helpers (~> 1.0.0)
cssbundling-rails (~> 1.4)
cucumber-rails (>= 2.6.1)
database_cleaner (>= 2.0.1)
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ If you do not want to run Sidekiq, pass the `--no-sidekiq` to the `bin/dev` comm
### Design & frontend

The design of the app is closely based on the [GOV.UK Design System][] with some minor CCS-related variations.
The project uses and extends the [GOV.UK Frontend][] npm package.
The project uses and extends the [CCS Frontend][] and [GOV.UK Frontend][] npm packages.

The npm package dependencies are listed in `package.json`, installed using [yarn][], and the exact versions of all dependencies direct/indirect are locked in `yarn.lock`.

Expand Down Expand Up @@ -359,6 +359,7 @@ environments:
[feature-specs]: https:/Crown-Commercial-Service/crown-marketplace/tree/master/spec/features
[factory_bot_rails]: https:/thoughtbot/factory_bot_rails
[GOV.UK Frontend]: https:/alphagov/govuk-frontend
[CCS Frontend]: https:/tim-s-ccs/ccs-frontend-project
[yarn]: https:/yarnpkg/yarn
[GOV.UK Design System]: https://design-system.service.gov.uk/
[Block Element Modifier]: http://getbem.com/
Expand Down
10 changes: 10 additions & 0 deletions app/assets/config/manifest.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,12 @@
// Application assets
//= link_tree ../images
//= link_tree ../builds

// Assets from node modules
//= link favicon.ico
//= link favicon.svg
//= link ccs-icon-mask.svg
//= link ccs-icon-180.png
//= link ccs-icon-192.png
//= link ccs-icon-512.png
//= link ccs-opengraph-image.png
Binary file removed app/assets/images/ccs-icon-180.png
Binary file not shown.
Binary file removed app/assets/images/ccs-icon-192.png
Binary file not shown.
Binary file removed app/assets/images/ccs-icon-512.png
Binary file not shown.
Binary file removed app/assets/images/ccs-opengraph-image.png
Binary file not shown.
Binary file removed app/assets/images/favicon.ico
Binary file not shown.
1 change: 0 additions & 1 deletion app/assets/images/favicon.svg

This file was deleted.

1 change: 0 additions & 1 deletion app/assets/images/mask-icon.svg

This file was deleted.

4 changes: 2 additions & 2 deletions app/assets/stylesheets/application.sass.scss
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Import our settings for CCS and GOV.UK
@import "settings/all";

// Import the govuk-frontend assets
@import "govuk-frontend/dist/govuk/all";
// Import the ccs-frontend and govuk-frontend assets
@import "ccs-frontend/dist/ccs/all";

// Import the additional CCS components
@import "components/all";
Expand Down
2 changes: 0 additions & 2 deletions app/assets/stylesheets/components/_all.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@
@import "basket/basket";
@import "checkbox-accordion/checkbox-accordion";
@import "dashboard-section/dashboard-section";
@import "header/header";
@import "footer/footer";
@import "info-panel/info-panel";
@import "logo/logo";
@import "notification-banner/notification-banner";
@import "panel/panel";
@import "password-rules/password-rules";
Expand Down
182 changes: 0 additions & 182 deletions app/assets/stylesheets/components/footer/_footer.scss
Original file line number Diff line number Diff line change
@@ -1,185 +1,3 @@
$ccs-footer-background: ccs-colour("black");
$ccs-footer-border: $ccs-border-colour;
// This variable can be removed entirely once the legacy palette goes away,
// as it'll just be the same as $ccs-footer-border.
$ccs-footer-border-top: $ccs-border-colour;
$ccs-footer-text: ccs-colour("white");

$ccs-footer-columns-to-rows-point: 501px;

.ccs-footer {
@include govuk-font($size: 16);
@include govuk-responsive-padding(7, "top");
@include govuk-responsive-padding(5, "bottom");

border-top: 1px solid $ccs-footer-border-top;
color: $ccs-footer-text;
background: $ccs-footer-background;
}

.ccs-footer__link {
@include govuk-link-common;

&:link,
&:visited,
&:hover {
color: $ccs-footer-text;
}

&:active,
&:focus {
color: $govuk-focus-text-colour;
}

&:link:focus {
@include govuk-text-colour;
}
}

.ccs-footer__section-break {
margin: 0; // Reset `<hr>` default margins
@include govuk-responsive-margin(8, "bottom");
border: 0; // Reset `<hr>` default borders
border-bottom: 1px solid $ccs-footer-border;
}

.ccs-footer__meta {
display: flex; // Support: Flexbox
margin-right: -$govuk-gutter-half;
margin-left: -$govuk-gutter-half;
flex-wrap: wrap; // Support: Flexbox
align-items: flex-end; // Support: Flexbox
justify-content: center; // Support: Flexbox
text-align: right;
}

.ccs-footer__meta-item {
margin-right: $govuk-gutter-half;
margin-bottom: govuk-spacing(5);
margin-left: $govuk-gutter-half;

@include govuk-media-query ($until: $ccs-footer-columns-to-rows-point) {
&:first-child {
order: 2;
}
}
}

.ccs-footer__meta-item--grow {
flex: 1; // Support: Flexbox

@include govuk-media-query ($until: tablet) {
flex-basis: 320px; // Support: Flexbox
}

@include govuk-media-query ($until: $ccs-footer-columns-to-rows-point) {
text-align: left;
}
}

.ccs-footer__inline-list {
margin-top: 0;
margin-bottom: govuk-spacing(3);
padding: 0;

&:last-child {
margin-bottom: 0;
}
}

.ccs-footer__meta-custom {
a {
color: $ccs-footer-text;
}
}

.ccs-footer__inline-list-item {
display: inline-block;
margin-bottom: govuk-spacing(1);
margin-left: govuk-spacing(3);

@include govuk-media-query ($until: tablet) {
margin-right: govuk-spacing(3);
margin-left: 0;
}
}

.ccs-footer__inline-list--bottom > .ccs-footer__inline-list-item {
margin-bottom: 0;
}

.ccs-footer__heading {
margin-bottom: govuk-spacing(6);
padding-bottom: govuk-spacing(4);

@include govuk-media-query ($until: tablet) {
padding-bottom: govuk-spacing(2);
}
border-bottom: 1px solid $ccs-footer-border;
color: $ccs-footer-text;
}

.ccs-footer__navigation {
@include govuk-clearfix;
margin-right: -$govuk-gutter-half;
margin-left: -$govuk-gutter-half;
}

.ccs-footer__section {
display: inline-block;
margin-bottom: $govuk-gutter;
vertical-align: top;
}

.ccs-footer__list {
margin: 0;
padding: 0;
list-style: none;
column-gap: $govuk-gutter; // Support: Columns

// Disable thicker underlines on hover because of a bug in Chromium
// affecting links within columns
// https://bugs.chromium.org/p/chromium/issues/detail?id=1190987
.ccs-footer__link:hover {
text-decoration-thickness: auto;
}
}

@include govuk-media-query ($from: desktop) {
.ccs-footer__list--columns-2 {
column-count: 2; // Support: Columns
}

.ccs-footer__list--columns-3 {
column-count: 3; // Support: Columns
}
}

.ccs-footer__list-item {
@include govuk-responsive-margin(4, "bottom");
}

.ccs-footer__list-item:last-child {
margin-bottom: 0;
}

.ccs-footer__logo {
@include govuk-responsive-margin(5, "bottom");
box-sizing: border-box;

@include govuk-media-query ($from: tablet) {
width: 100%;
padding-right: $govuk-gutter-half;
float: left;
vertical-align: top;
}
}

.ccs-footer__copyright {
margin-left: 0;
text-align: center;
}

.footer-feedback {
background-color: govuk-colour("light-grey");
}
Loading

0 comments on commit 9db8e26

Please sign in to comment.