Skip to content
This repository has been archived by the owner on Aug 29, 2022. It is now read-only.

styling updates #50

Merged
merged 20 commits into from
Aug 5, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
d92168e
added _ to scss file names, started testing @extend
michellexliu Aug 2, 2021
66755c2
styling changes for checkboxes
michellexliu Aug 2, 2021
fb0f6bb
Merge branch 'dev' into story/sass-refactor
michellexliu Aug 2, 2021
6e72c57
converted rest of styling-classnames to @extend, added drop shadow on…
michellexliu Aug 2, 2021
1ba18bc
updated spacing in plaintext section, turned plaintext into div and s…
michellexliu Aug 2, 2021
d21e4fe
grouped commmon styles together, created mixin to set mobile-lg style…
michellexliu Aug 3, 2021
3996c9e
header logo resolution and alignment:
ksiegel1923 Aug 3, 2021
1cfc54d
re-organized sass architecture: created abstracts folder, set up them…
michellexliu Aug 3, 2021
5c730e4
renamed feedback-module classes to follow bem conventions
michellexliu Aug 3, 2021
33500fb
Merge branch 'dev' into story/sass-refactor
michellexliu Aug 3, 2021
defbd30
updated config for plainText to array
michellexliu Aug 3, 2021
8d4a330
deleted console.log
michellexliu Aug 3, 2021
a58bca4
deleted unnecessary div
michellexliu Aug 3, 2021
ab094db
Merge branch 'story/header-logo' of https://github.com/nyc-cto/feedba…
michellexliu Aug 4, 2021
26cafd6
added header changes
michellexliu Aug 4, 2021
9461ad8
changed from last-child to last-of-type
michellexliu Aug 4, 2021
0b206c7
updated checkbox size, moved logo styling to .scss file
michellexliu Aug 4, 2021
c670f4e
set buttons to be full width on mobile view
michellexliu Aug 4, 2021
2cabd87
implemented rapi's suggestions: renamed h1 to heading, deleted _ from…
michellexliu Aug 4, 2021
d37cf1e
fixed export.module.scss variables import
michellexliu Aug 4, 2021
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
Prev Previous commit
Next Next commit
re-organized sass architecture: created abstracts folder, set up them…
…es folder in case we want to support multiple themes for stretch goal, split components into different files for improved modularity
  • Loading branch information
michellexliu committed Aug 3, 2021
commit 1cfc54d9cf6e2d542e93c6e06d806ed17f5c23e1
4 changes: 2 additions & 2 deletions feedback-module/src/components/Module.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,15 +157,15 @@ function Module({ pagetitle, endpoint, dir }) {
{screen.titleInverse && (
<Grid className={"bg-primary feedback-screen-container"}>
<p
className="font-sans-md2 feedback-h1 feedback-h1--light"
className="font-sans-md2 feedback-h1 feedback-h1--inverse"
dangerouslySetInnerHTML={{ __html: t(screen.titleInverse) }}
></p>
</Grid>
)}
{
<LightContainer formID={screen.formID}>
{screen.title && (
<p className="font-sans-md2 feedback-h1 feedback-h1--dark">
<p className="font-sans-md2 feedback-h1 feedback-h1--default">
{`${t(screen.title, { page: pagetitle })}${
screen.checkboxes && screen.checkboxes.required ? "*" : ""
}`}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
@use "sass:list";

// Sets styling for mobile-lg viewport size
@mixin mobile-lg($properties...) {
@each $property in $properties {
@extend .mobile-lg\:#{$property} !optional; // Sets styling locally
@extend .mobile-lg-#{$property} !optional; // Sets styling in build
}
}

// Common Styles
.usa-checkbox,
.usa-label,
Expand All @@ -21,20 +11,17 @@
@extend .text-primary;
}

.usa-label,
.usa-checkbox,
.usa-checkbox__label,
.feedback-h1 {
@extend .text-bold;
}

.feedback-module-container,
.usa-button:hover,
.usa-textarea,
.usa-input {
@extend .bg-primary-light;
}

.feedback-header {
@extend .bg-primary;
}

.feedback-plaintext,
.usa-checkbox,
.usa-input,
Expand Down Expand Up @@ -62,59 +49,23 @@
@extend .display-flex;
}

// Buttons
.usa-button {
@extend .flex-align-self-start,
.width-auto,
.text-left,
.border-transparent,
.padding-105,
.border-2px,
.shadow-btn,
.margin-y-1;
@include mobile-lg(
"padding-x-205",
"padding-y-105",
"font-sans-md2",
"margin-y-105"
);
&:hover {
@extend .border-primary, .border-bottom-2px;
}
}

// Checkbox
.usa-checkbox {
@extend .bg-transparent, .margin-y-1, .text-no-uppercase;
@include mobile-lg("margin-y-105");
.grid-container[dir="rtl"] {
@extend .text-right;
}

.usa-label {
@extend .font-sans-md2,
.line-height-sans-2,
.maxw-none,
.margin-y-205,
.text-no-uppercase;
}

.usa-textarea,
.usa-input {
@extend .border-05, .border-primary;
&:focus {
@extend .border-width-6px, .bg-primary-lighter;
}
}

.usa-input {
@extend .height-auto, .flex-1;
.usa-label,
.usa-checkbox,
.usa-checkbox__label,
.feedback-h1 {
@extend .text-bold;
}

.usa-form {
@extend .maxw-none, .width-full, .flex-column, .flex-align-stretch;
}

.feedback-header {
@extend .radius-top-lg, .bg-primary, .padding-1;
@extend .radius-top-lg, .padding-1;
@include mobile-lg("padding-x-2", "padding-y-105");
}

Expand All @@ -134,11 +85,10 @@
.margin-bottom-3,
.text-no-uppercase,
.line-height-sans-2;

&--light {
&--inverse {
@extend .text-white;
}
&--dark {
&--default {
@extend .text-primary;
}
}
Expand All @@ -151,3 +101,9 @@
@extend .margin-0;
}
}

.grid-container[dir="rtl"] {
.feedback-h1 {
@extend .text-right;
}
}
40 changes: 0 additions & 40 deletions feedback-module/src/styles/_reset.scss

This file was deleted.

33 changes: 0 additions & 33 deletions feedback-module/src/styles/_variables.scss

This file was deleted.

9 changes: 9 additions & 0 deletions feedback-module/src/styles/abstracts/_mixins.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
@use "sass:list";

// Sets styling for mobile-lg viewport size
@mixin mobile-lg($properties...) {
@each $property in $properties {
@extend .mobile-lg\:#{$property} !optional; // Sets styling locally
@extend .mobile-lg-#{$property} !optional; // Sets styling in build
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,26 +44,3 @@ $height-settings: map-merge(
responsive: true,
)
);

// Colors
$theme-color-primary: $feedback__dark;
$theme-color-primary-light: $feedback__light;
$theme-color-base: $feedback__dark;
$theme-color-primary-lighter: $feedback__lightest;

// Typography
$theme-font-type-sans: "public-sans";
$theme-process-list-heading-color: "primary";

// Buttons
$theme-button-border-radius: "md";

//Checkbox
$theme-checkbox-border-radius: 0;

// Alert:
$theme-alert-bar-width: 1;
$theme-alert-padding-x: 2;
$theme-color-error-lighter: $error-alert-bg-color;
$theme-color-error: $error-alert-bar-color;
$theme-color-base-ink: $alert-text-color; //alert text color
12 changes: 12 additions & 0 deletions feedback-module/src/styles/abstracts/_variables.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// Colors
$feedback__dark: #162e51;
$feedback__light: #e1f3f8;
$feedback__white: #ffffff;
$feedback__lightest: #f3fcff;
$base__dark: #042d36;
$error__lighter: #ffe8e6;
$error: #d24425;

$error-alert-bg-color: $error__lighter;
$error-alert-bar-color: $error;
$alert-text-color: $base__dark;
25 changes: 25 additions & 0 deletions feedback-module/src/styles/components/_button.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
.usa-button {
@extend .flex-align-self-start,
.width-auto,
.text-left,
.border-transparent,
.padding-105,
.border-2px,
.shadow-btn,
.margin-y-1;
@include mobile-lg(
"padding-x-205",
"padding-y-105",
"font-sans-md2",
"margin-y-105"
);
&:hover {
@extend .border-primary, .border-bottom-2px;
}
}

.grid-container[dir="rtl"] {
.usa-button {
@extend .text-right;
}
}
31 changes: 31 additions & 0 deletions feedback-module/src/styles/components/_checkbox.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// Checkbox
.usa-checkbox {
@extend .bg-transparent, .margin-y-1, .text-no-uppercase;
@include mobile-lg("margin-y-105");
@media screen and (max-width: 479px) {
&__label {
padding-left: 0rem;
text-indent: 0rem;
display: grid;
grid-auto-flow: column;
&::before {
height: 2rem;
width: 2rem;
margin-right: 1.375rem;
}
}
}
}

.grid-container[dir="rtl"] {
.usa-checkbox__label {
@extend .text-indent-0;
&::before {
@extend .margin-left-105, .margin-right-0, .right-2px, .left-0;

@media screen and (max-width: 479px) {
margin-left: 1.375rem;
}
}
}
}
3 changes: 3 additions & 0 deletions feedback-module/src/styles/components/_required.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@import "button";
@import "checkbox";
@import "textbox";
19 changes: 19 additions & 0 deletions feedback-module/src/styles/components/_textbox.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
.usa-label {
@extend .font-sans-md2,
.line-height-sans-2,
.maxw-none,
.margin-y-205,
.text-no-uppercase;
}

.usa-textarea,
.usa-input {
@extend .border-05, .border-primary;
&:focus {
@extend .border-width-6px, .bg-primary-lighter;
}
}

.usa-input {
@extend .height-auto, .flex-1;
}
10 changes: 6 additions & 4 deletions feedback-module/src/styles/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@
@import "~uswds/src/stylesheets/theme/_uswds-theme-utilities.scss";
@import "~uswds/src/stylesheets/packages/_required.scss";

@import "variables";
@import "theme";
@import "abstracts/variables";
@import "abstracts/settings";
@import "abstracts/mixins";
@import "themes/default";

#feedback-widget {
@import "uswds";
@import "reset";
@import "components";
@import "base";
@import "components/required";
}
22 changes: 22 additions & 0 deletions feedback-module/src/styles/themes/_default.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Colors
$theme-color-primary: $feedback__dark;
$theme-color-primary-light: $feedback__light;
$theme-color-base: $feedback__dark;
$theme-color-primary-lighter: $feedback__lightest;

// Typography
$theme-font-type-sans: "public-sans";
$theme-process-list-heading-color: "primary";

// Buttons
$theme-button-border-radius: "md";

//Checkbox
$theme-checkbox-border-radius: 0;

// Alert:
$theme-alert-bar-width: 1;
$theme-alert-padding-x: 2;
$theme-color-error-lighter: $error-alert-bg-color;
$theme-color-error: $error-alert-bar-color;
$theme-color-base-ink: $alert-text-color; //alert text color
Loading