diff --git a/CHANGELOG.md b/CHANGELOG.md index f9e3ee58..c542ee09 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ - Reduce the border width of the normal outline button to the intended width of `1px` (previously `2px`). The big variant of the outline button is unaffected by this change, and remains `2px`. - Fix rounded corners on sidebar current page item. - Fix unintentional rounded corners on search text field. +- Fix utility classes not always applying as expected when applied to components. For example, using `margin-` utility classes on an unstyled button would previously unexpectedly conflict with and not take precedent over the button's own margins. ## 5.0.3 diff --git a/gulpfile.js b/gulpfile.js index 75f6bdf4..db4914c3 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -10,7 +10,6 @@ const gulpif = require('gulp-if'); const sass = require('gulp-sass'); const gulpStylelint = require('gulp-stylelint'); const sourcemaps = require('gulp-sourcemaps'); -const uswds = require('uswds-gulp/config/uswds'); const browserify = require('browserify'); const babel = require('gulp-babel'); const source = require('vinyl-source-stream'); @@ -99,7 +98,7 @@ gulp.task('build-js', () => { gulp.task('watch-js', () => gulp.watch(`${PROJECT_JS_SRC}/**/*.js`, gulp.series('build-js'))); gulp.task('lint-sass', () => - gulp.src(`${PROJECT_SASS_SRC}/**/*.scss`).pipe( + gulp.src([`${PROJECT_SASS_SRC}/**/*.scss`, `!${PROJECT_SASS_SRC}/uswds/**/*.scss`]).pipe( gulpStylelint({ failAfterError: true, reporters: [{ formatter: 'string', console: true }], @@ -122,11 +121,7 @@ gulp.task('build-sass', () => { .src([`${PROJECT_SASS_SRC}/*.scss`]) .pipe(replace(/\buswds @version\b/g, `uswds v${uswdsPkg.version}`)) .pipe(sourcemaps.init({ largeFile: true })) - .pipe( - sass({ - includePaths: [PROJECT_SASS_SRC, `${uswds}/scss`, `${uswds}/scss/packages`], - }).on('error', notificationOptions.handler), - ) + .pipe(sass().on('error', notificationOptions.handler)) .pipe(postcss(plugins)) .pipe(gulp.dest(CSS_DEST)) .pipe(notify(notificationOptions.success)); @@ -146,7 +141,6 @@ const underscorePrefix = () => gulpif((f) => f.basename[0] !== '_', rename({ pre gulp.task('copy-login-scss', () => gulp .src([`${PROJECT_SASS_SRC}/**/*.scss`]) - .pipe(replace("@import 'uswds'", "@import 'uswds/uswds'")) .pipe(replaceUrls()) .pipe(underscorePrefix()) .pipe(gulp.dest(SCSS_DEST)), @@ -154,13 +148,13 @@ gulp.task('copy-login-scss', () => gulp.task('copy-uswds-scss', () => gulp - .src([`${uswds}/scss/**/*.scss`]) + .src(['node_modules/uswds/dist/scss/**/*.scss']) .pipe(replaceUrls()) .pipe(underscorePrefix()) .pipe(gulp.dest(`${SCSS_DEST}/uswds`)), ); -gulp.task('copy-scss', gulp.parallel('copy-login-scss', 'copy-uswds-scss')); +gulp.task('copy-scss', gulp.series('copy-login-scss', 'copy-uswds-scss')); gulp.task('lint', gulp.parallel('lint-js', 'lint-sass')); diff --git a/package-lock.json b/package-lock.json index 6f7de5a6..670edfc1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19602,11 +19602,6 @@ } } }, - "uswds-gulp": { - "version": "github:uswds/uswds-gulp#5e32f1b99279a6e50ad875e66cc4cb77b456c390", - "from": "github:uswds/uswds-gulp", - "dev": true - }, "util": { "version": "0.12.3", "resolved": "https://registry.npmjs.org/util/-/util-0.12.3.tgz", diff --git a/package.json b/package.json index 203d2e69..6562f79f 100644 --- a/package.json +++ b/package.json @@ -100,7 +100,6 @@ "serve": "^11.3.2", "stylelint": "^13.7.2", "stylelint-scss": "^3.18.0", - "uswds-gulp": "github:uswds/uswds-gulp", "vinyl-buffer": "^1.0.1", "vinyl-source-stream": "^2.0.0", "wait-on": "^5.3.0", diff --git a/src/scss/styles.scss b/src/scss/styles.scss index 008aa09d..e1599964 100644 --- a/src/scss/styles.scss +++ b/src/scss/styles.scss @@ -8,7 +8,9 @@ @import 'uswds-theme/utilities'; @import 'uswds-theme/components'; -@import 'uswds'; +@import 'uswds/packages/required'; +@import 'uswds/packages/global'; +@import 'uswds/packages/uswds-components'; @import 'functions/focus'; @@ -27,3 +29,5 @@ @import 'components/spinner'; @import 'components/typography'; @import 'components/verification-badge'; + +@import 'uswds/packages/uswds-utilities'; diff --git a/src/scss/uswds b/src/scss/uswds new file mode 120000 index 00000000..bab786d2 --- /dev/null +++ b/src/scss/uswds @@ -0,0 +1 @@ +../../node_modules/uswds/dist/scss \ No newline at end of file