Skip to content

Commit

Permalink
Merge branch 'main' into WD-18329-cleanup-type-files
Browse files Browse the repository at this point in the history
  • Loading branch information
steverydz authored Jan 21, 2025
2 parents 5c4514f + 28f15ba commit 171cdcb
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 11 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"test-python": "yarn run lint-python && FLASK_DEBUG=0 python3 -m unittest discover tests",
"test-python-job": "SECRET_KEY=insecure_secret_key coverage run --source=. -m unittest discover tests",
"build": "yarn run build-js && yarn run build-css",
"build-css": "sass static/sass/styles.scss:static/css/styles.css static/sass/styles-embedded.scss:static/css/styles-embedded.css --load-path=node_modules --style=compressed && postcss --use autoprefixer --no-map --replace 'static/css/**/*.css'",
"build-css": "sass --quiet-deps --silence-deprecation=import static/sass/styles.scss:static/css/styles.css static/sass/styles-embedded.scss:static/css/styles-embedded.css --load-path=node_modules --style=compressed && postcss --use autoprefixer --no-map --replace 'static/css/**/*.css'",
"build-js": "yarn run copy-3rd-party-js && yarn run build-js-bundle",
"copy-3rd-party-js": "mkdir -p static/js/modules && cp node_modules/d3/dist/d3.min.js static/js/modules && cp node_modules/clipboard/dist/clipboard.min.js static/js/modules && cp node_modules/raven-js/dist/raven.min.js static/js/modules",
"build-js-bundle": "webpack && yarn build-latest-news",
Expand Down
6 changes: 4 additions & 2 deletions static/sass/_patterns_first-snap-flow.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@use "sass:map";

@mixin snapcraft-p-first-snap-flow {
.p-flow-details {
width: 100%;
Expand All @@ -16,11 +18,11 @@
// before this vanilla bug is fixed:
// https://github.com/canonical-web-and-design/vanilla-framework/issues/2301
.p-accordion p {
margin-bottom: map-get($sp-after, p) - map-get($nudges, nudge--p);
margin-bottom: map.get($sp-after, p) - map.get($nudges, nudge--p);
}

.p-accordion__panel {
$icon-size: map-get($icon-sizes, accordion);
$icon-size: map.get($icon-sizes, accordion);

overflow: visible;
padding-left: $sph--large + $icon-size + $sph--large; // same as accordion button
Expand Down
4 changes: 3 additions & 1 deletion static/sass/_snapcraft_p-build.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
@use "sass:map";

@mixin snapcraft-p-build {
$icon-size: map-get($icon-sizes, default);
$icon-size: map.get($icon-sizes, default);

.p-icon--github-white {
@extend %icon;
Expand Down
10 changes: 6 additions & 4 deletions static/sass/_snapcraft_p-progressive-bar.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
@use "sass:color";

@mixin snapcraft-p-progressive-bar {
$inactive: scale-color($color-link, $lightness: 90%);
$inactive: color.scale($color-link, $lightness: 90%);
$active: $color-link;
$target: scale-color($color-link, $lightness: -20%);
$target: color.scale($color-link, $lightness: -20%);

%bar {
border-radius: 9px 0 0 9px;
Expand Down Expand Up @@ -45,11 +47,11 @@
pointer-events: none;

.progressive-bar__current {
background: lighten(grayscale($active), 20);
background: color.adjust(color.grayscale($active), $lightness: 20%, $space: hsl);
}

.progressive-bar__target {
background: lighten(grayscale($target), 20);
background: color.adjust(color.grayscale($target), $lightness: 20%, $space: hsl);
}
}

Expand Down
6 changes: 4 additions & 2 deletions static/sass/styles.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@use "sass:map";

// colour definitions
$ubuntu-orange: #e95420;
$color-brand: #00302f;
Expand All @@ -20,7 +22,7 @@ $font-display-option: swap;
$breakpoint-medium: 619px;

// vanilla patterns
@import "vanilla-framework/scss/vanilla";
@import "vanilla-framework";
@include vanilla;

// import cookie policy
Expand Down Expand Up @@ -416,7 +418,7 @@ dl {
background-color: $colors--light-theme--border-default;
display: block;
height: 100%;
left: map-get($grid-gutter-widths, default) * -0.5;
left: map.get($grid-gutter-widths, default) * -0.5;
position: absolute;
width: 1px;
}
Expand Down
14 changes: 13 additions & 1 deletion webpack.config.rules.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,19 @@ module.exports = [
},
{
test: /\.s[ac]ss$/i,
use: ["style-loader", "css-loader", "sass-loader"],
use: [
"style-loader",
"css-loader",
{
loader: "sass-loader",
options: {
sassOptions: {
quietDeps: true,
silenceDeprecations: ["import", "global-builtin"],
},
},
},
],
},
// TODO:
// we should get rid of using globals making expose-loader unnecessary
Expand Down

0 comments on commit 171cdcb

Please sign in to comment.