Skip to content

Commit a0477cc

Browse files
authored
Fix video embed size in why page (#161)
* give why.html iframe embeds natural width & height * added title attr to iframes for accNames * updated webpack config OptimizeCSSAssetsPlugin options: - disable calc optimization to prevent mangling of css custom properties inside calc() * formatted webpack config
1 parent a6abe3a commit a0477cc

File tree

2 files changed

+32
-8
lines changed

2 files changed

+32
-8
lines changed

app/src/hbs_templates/why.hbs

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,11 @@
8181
<div class="video" style="--aspect-ratio: 16/9;">
8282
<iframe
8383
src="https://www.youtube.com/embed/uvZWZy9uZqA"
84+
{{!-- TODO: add translation for title attribute --}}
85+
title="Video: How Did We Get Here?"
8486
frameborder="0"
87+
width="960"
88+
height="540"
8589
loading="lazy"
8690
allowfullscreen
8791
>
@@ -92,7 +96,11 @@
9296
<div class="video" style="--aspect-ratio: 16/9;">
9397
<iframe
9498
src="https://www.youtube.com/embed/9MB-BhoUXg4"
99+
{{!-- TODO: add translation for title attribute --}}
100+
title="Video: What's Vacancy Decontrol"
95101
frameborder="0"
102+
width="960"
103+
height="540"
96104
loading="lazy"
97105
allowfullscreen
98106
>
@@ -103,7 +111,11 @@
103111
<div class="video" style="--aspect-ratio: 16/9;">
104112
<iframe
105113
src="https://www.youtube.com/embed/Yn8tj-8-TeE"
114+
{{!-- TODO: add translation for title attribute --}}
115+
title="Video: Tenant's project, The Bronx"
106116
frameborder="0"
117+
width="960"
118+
height="540"
107119
loading="lazy"
108120
allowfullscreen
109121
>
@@ -114,7 +126,11 @@
114126
<div class="video" style="--aspect-ratio: 16/9;">
115127
<iframe
116128
src="https://www.youtube.com/embed/6oSbEpdL968"
129+
{{!-- TODO: add translation for title attribute --}}
130+
title="Video: Tenant's project, Bushwick"
117131
frameborder="0"
132+
width="960"
133+
height="540"
118134
loading="lazy"
119135
allowfullscreen
120136
>
@@ -125,7 +141,11 @@
125141
<div class="video" style="--aspect-ratio: 16/9;">
126142
<iframe
127143
src="https://www.youtube.com/embed/TtZmANXveXg"
144+
{{!-- TODO: add translation for title attribute --}}
145+
title="Video: Tenant's project, Chinatown"
128146
frameborder="0"
147+
width="960"
148+
height="540"
129149
loading="lazy"
130150
allowfullscreen
131151
>
@@ -166,4 +186,4 @@
166186
{{not_rs.p2.three}}
167187
</p>
168188
</main>
169-
</div>
189+
</div>

app/webpack.config.js

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const MiniCssExtractPlugin = require("mini-css-extract-plugin");
88
const OptimizeCSSAssetsPlugin = require("optimize-css-assets-webpack-plugin");
99
const TerserJSPlugin = require("terser-webpack-plugin");
1010
const StylelintPlugin = require("stylelint-webpack-plugin");
11-
const ESLintPlugin = require('eslint-webpack-plugin');
11+
const ESLintPlugin = require("eslint-webpack-plugin");
1212

1313
// `module.exports` is NodeJS's way of exporting code from a file,
1414
// so that it can be made available in other files. It's what
@@ -139,7 +139,7 @@ module.exports = (env, argv) => {
139139
options: {
140140
cacheDirectory: true,
141141
},
142-
}
142+
},
143143
],
144144
},
145145

@@ -191,7 +191,13 @@ module.exports = (env, argv) => {
191191
extractComments: true,
192192
sourceMap: true,
193193
}),
194-
new OptimizeCSSAssetsPlugin({}),
194+
new OptimizeCSSAssetsPlugin({
195+
cssProcessorPluginOptions: {
196+
// disable calc optimization as it incorrectly removes parenthesis around css custom properties
197+
// this happens in _embed.scss with `calc(100% / (var(--aspect-ratio)))`
198+
preset: ["default", { calc: false }],
199+
},
200+
}),
195201
],
196202

197203
// how webpack should split our code compiled into separate files for production
@@ -291,12 +297,10 @@ module.exports = (env, argv) => {
291297
// want in production, such as logging
292298
new webpack.DefinePlugin({
293299
"process.env.NODE_ENV": JSON.stringify(env.NODE_ENV),
294-
"process.env.USE_REDUX_LOGGER": JSON.stringify(
295-
env.USE_REDUX_LOGGER
296-
),
300+
"process.env.USE_REDUX_LOGGER": JSON.stringify(env.USE_REDUX_LOGGER),
297301
"process.env.USE_PRELOADED_STATE": JSON.stringify(
298302
env.USE_PRELOADED_STATE
299-
)
303+
),
300304
}),
301305
],
302306
};

0 commit comments

Comments
 (0)