#ObjectFit
Perfect your image layouts with object-fit 🖼️💡 Clean, pro-level CSS – visit javidev (link in my profile) – creation: mystic.js
#csstips #objectfit #webdevelopment #frontenddesign #csstricks #devlife #webdesign #responsivecss #buildinpublic #mysticdev
June 10, 2025 at 10:02 PM
here's the dev comment i'm basing that on, btw, there's some example of how they'll look at the link
Recent regression in display of image embeds without pre-existing dimensions data · Issue #6800 · bluesky-social/social-app
Steps to Reproduce Taking this post as an example https://bsky.app/profile/macthemes.bsky.social/post/3lbxkfazqdx2f It showed "as expected" on 1.94 But shows up with objectFit: cover on 1.95, which...
github.com
November 29, 2024 at 2:21 PM
Master image sizing with object-fit in CSS 🎯
Values: cover, contain, fill, none, scale-down
💡 Tip:

css
Copy
Edit
img {
width: 100%;
height: 300px;
object-fit: cover;
}
No more distorted images!
#CSS #WebDev #FrontendTips #ObjectFit #ResponsiveDesign #HTML #WebDevTips #ImageStyling #UIDesign
May 14, 2025 at 8:20 PM
when the row is filled, it sizes the images down based on the width/height, so a landscape drawing will get more horizontal space, and then we use objectFit: contain to make the image not stretch in its container
January 9, 2026 at 12:27 AM
If you run a bot or a crossposter, and you're confused why your images are being displayed in weird boxes right now: you have to update your image uploading code to pass the new `aspectRatio` data. github.com/bluesky-soci...
Recent regression in display of image embeds without pre-existing dimensions data · Issue #6800 · bluesky-social/social-app
Steps to Reproduce Taking this post as an example https://bsky.app/profile/macthemes.bsky.social/post/3lbxkfazqdx2f It showed "as expected" on 1.94 But shows up with objectFit: cover on 1.95, which...
github.com
December 20, 2024 at 8:18 PM
Bluesky: ruining previously posted images since 2024

github.com/bluesky-soci...
April 23, 2026 at 1:20 AM
almost certainly it's missing the "aspectRatio" field in the post record. In short the official bluesky app renders it this way to prevent layout shifts and performance issues. More info in the github issue below

github.com/bluesky-soci...
Recent regression in display of image embeds without pre-existing dimensions data · Issue #6800 · bluesky-social/social-app
Steps to Reproduce Taking this post as an example https://bsky.app/profile/macthemes.bsky.social/post/3lbxkfazqdx2f It showed "as expected" on 1.94 But shows up with objectFit: cover on 1.95, which...
github.com
December 15, 2025 at 6:42 AM
🎯 Master object-fit in CSS:

• cover – fill & crop
• contain – fit, no crop
• fill – stretch (may distort)
• none – no scale
• scale-down – smallest fit

💡 Tip:
img {
 width: 100%;
 height: 300px;
 object-fit: cover;
}

No more ugly images! 🚀
.
#CSS #WebDev #Frontend #objectfit #CodeTips #codelife
May 1, 2025 at 12:33 PM
Here's the bug report. github.com/bluesky-soci...

Many third party apps including @deck.blue were not sending image dimension data along with uploads. But there was no indication it was bad because Bluesky didn't crop the image. But as of v1.95 they changed the frontend to crop into a square.
Recent regression in display of image embeds without pre-existing dimensions data · Issue #6800 · bluesky-social/social-app
Steps to Reproduce Taking this post as an example https://bsky.app/profile/macthemes.bsky.social/post/3lbxkfazqdx2f It showed "as expected" on 1.94 But shows up with objectFit: cover on 1.95, which...
github.com
November 30, 2024 at 2:56 AM
🎉 PixiJS Layout v3 is here! 🎉

• A complete ground-up rewrite built on Yoga!
• Opt-in layout for any PixiJS object
• Web-style features like objectFit, objectPosition, and overflow

Check out the full details in our blog post:
pixijs.com/blog/layout-v3
PixiJS Layout v3 is here! 🎉 | PixiJS
The new Layout v3 is here! With a new API, better performance, and more features.
pixijs.com
April 29, 2025 at 2:52 PM
Yup! I don’t think they communicated this change outside the comments on a year old github issue so it’s been very easy to miss. github.com/bluesky-soci...
Recent regression in display of image embeds without pre-existing dimensions data · Issue #6800 · bluesky-social/social-app
Steps to Reproduce Taking this post as an example https://bsky.app/profile/macthemes.bsky.social/post/3lbxkfazqdx2f It showed "as expected" on 1.94 But shows up with objectFit: cover on 1.95, which...
github.com
November 22, 2025 at 8:36 PM
@danabra.mov said here: "I'm fairly certain that we're not going to roll back this change — it has to be done at some point because we can't tolerate layout shifts (jumping content) in feeds, and having even a single post like this in a feed causes everything below it to jump."
Recent regression in display of image embeds without pre-existing dimensions data · Issue #6800 · bluesky-social/social-app
Steps to Reproduce Taking this post as an example https://bsky.app/profile/macthemes.bsky.social/post/3lbxkfazqdx2f It showed "as expected" on 1.94 But shows up with objectFit: cover on 1.95, which...
github.com
December 13, 2024 at 8:13 PM
在鸿蒙NEXT中实现完全自定义导航栏
在日常app开发中,导航栏扮演着重要的角色。鸿蒙提供了系统导航栏Navigation,它支持很多属性的修改,但是应用需求更加灵活多变,比如有的导航栏有背景图片,有的导航栏要求渐变色,有的导航栏需要随时隐藏和显示等等。 遇到这些需求系统的Navigation就无法实现,这时候我们就需要自定义导航栏。今天分享一下幽蓝君自己封装的导航栏,并介绍一下它的实现过程。 作为一个导航栏,首先需要标题和返回按钮: Row() { Row(){ Image($r('app.media.back')) .width(20) .height(20) .objectFit(ImageFit.Contain) Text(this.title) .fontColor(Color.Black) .fontSize(23) .fontWeight(FontWeight.Bold) .margin({left:5}) .maxLines(1) } } .alignItems(VerticalAlign.Center) .backgroundImageSize(ImageSize.Cover) .width('100%').constraintSize({maxWidth:'100%'}) .linearGradient({ angle: 90, colors: [[0x00BAAD, 0.0], [0xDCF5F3, 0.6], [0xFFCCA6, 1.0]]}) .padding({left:15,right:15,top:px2vp(this.topRectHeight)}) .width('100%') .height(70) 上面的代码首先定义导航栏的高度是70,然后留出了顶部的状态栏区域,并设置了背景渐变色。这时候返回按钮和标题都分布在左侧。 除了返回按钮和标题,有时候我们在导航栏右侧也需要添加一些组件: @BuilderParam menuBuilderParam?: () => void; //右侧内容 Row(){ this.menuBuilderParam() }.constraintSize({ maxWidth:'50%'}) 导航栏的标题有时候我们需要它居中,那就在中间再添加一个标题组件,并使用一个状态判断标题是在左侧还是在中间: //枚举标题位置 export enum YLTitleMode { Center, Left} Row(){ Image($r('app.media.back')) .width(20) .height(20) .objectFit(ImageFit.Contain) if(this.titleModel == YLTitleMode.Left){ Text(this.title) .fontColor(Color.Black) .fontSize(23) .fontWeight(FontWeight.Bold) .margin({left:5}) .maxLines(1) } } if(this.titleModel == YLTitleMode.Center){ Text(this.title) .maxLines(1) .fontSize(23) .fontColor(Color.Black) .fontWeight(FontWeight.Bold) .textOverflow({ overflow: TextOverflow.Ellipsis }) .textAlign(TextAlign.Center) } 现在有一个问题,导航栏在左、右都有内容的情况下,怎么保持标题的居中?首先想到的是使用SpaceBetween对齐方式,但是这种对齐方式是相对于两侧内容的对齐,只有左右内容长度一致的情况下标题才能居中。 所以我想计算两侧组件的长度,并使他们保持一致: //右边布局 Row(){ this.menuBuilderParam() } .justifyContent(FlexAlign.End) .constraintSize({maxWidth:'40%'}) .width(parseInt(this.sizeValue)>parseInt(this.sizeValue2)?this.sizeValue:this.sizeValue2) .onSizeChange((oldValue: SizeOptions, newValue: SizeOptions)=>{ this.sizeValue = JSON.stringify(newValue.width) }) 这样的话当左侧也有自定义的内容时,计算两侧内容的长度,使用较大的值作为他俩的长度,标题就可以绝对居中了。 可能这么介绍会让很多友友摸不着头脑,我就分享代码大家直接拿过去用就行,发一个使用示例: YLNavigation({title:'自定义导航栏',menuBuilderParam:this.menu,customBuilder:this.mainPage,hideBackButton:true,titleModel:YLTitleMode.Left})
forem.com
March 23, 2025 at 10:33 AM
January 20, 2025 at 2:00 PM
Turns out I’m not the only one experiencing this

I hope they’ll fix this problem soon
December 3, 2024 at 12:54 PM
Entelligence AI's Detection⛵

It provided real-time suggestions without waiting for a pull request, identifying issues like:

→ Typo in CSS: Suggested 'cover' instead of 'coverd' for objectFit.
→ Invalid Font: Recommended 'sans-serif' instead of 'sans'.
July 9, 2025 at 6:30 AM
I once made this #codepen called “Super Simple Parallax Fullscreen Hero Header with Object-Fit.” Just saw it has 2,000+ views. Is that a lot? No clue—probably not. But it might’ve helped some people.

codepen.io/SaschaFromMa...

#frontenddevelopment #parallaxeffect #objectfit
April 15, 2025 at 2:50 PM
looks like they have a proposed fix to letterbox pre-existing images

getting strong "testing in prod" vibes from this though
Recent regression in display of image embeds without pre-existing dimensions data · Issue #6800 · bluesky-social/social-app
Steps to Reproduce Taking this post as an example https://bsky.app/profile/macthemes.bsky.social/post/3lbxkfazqdx2f It showed "as expected" on 1.94 But shows up with objectFit: cover on 1.95, which...
github.com
November 29, 2024 at 12:34 PM
鸿蒙Next开发实战教程—电影app
最近忙忙活活写了不少教程,但是总感觉千篇一律,没什么意思,大家如果有感兴趣的项目可以私信给幽蓝君写一写。 今天分享一个电影App。 这个项目也比较简单,主要是一些简单页面的开发和本地视频的播放以及横竖屏切换。 页面搭建以首页为例,很明显这是一个List页面,不过每一个部分都可以左右滑动,顶部banner部分是支持翻页的,所以使用Swiper组件实现,其他部分均使用Scroll组件实现。相关代码如下: build() { List(){ ListItem(){ Swiper(){ Image($r('app.media.headimg')) .width('100%') .height(380) .objectFit(ImageFit.Fill) .onClick(()=>{ router.pushUrl({ url:'pages/Info' }) }) } } ListItemGroup({header:this.ListHeader('分类',false)}){ ListItem(){ Scroll(){ Row(){ ForEach(this.types,(str:string,index)=>{ Text(str) .fontSize(15) .fontColor(Color.White) .padding({top:8,bottom:8,left:22,right:22}) .borderRadius(15) .backgroundColor(this.currentType == index ? '#6152FF':'rgb(6,4,31)') .onClick(()=>{ router.pushUrl({ url:'pages/MovieList' }) }) }) } } .scrollable(ScrollDirection.Horizontal) .scrollBar(BarState.Off) .width('100%') } } .padding({left:12,right:12}) ListItemGroup({header:this.ListHeader('最受欢迎',true)}){ ListItem(){ Scroll(){ Row({space:10}){ ForEach(this.popularMovies,(img:Resource,index)=>{ Image(img) .width(124) .height(180) .objectFit(ImageFit.Contain) .borderRadius(10) .onClick(()=>{ router.pushUrl({ url:'pages/Info' }) }) }) } } .scrollable(ScrollDirection.Horizontal) .scrollBar(BarState.Off) .width('100%') } } .padding({left:12,right:12}) ListItemGroup({header:this.ListHeader('最新电影',true)}){ ListItem(){ Scroll(){ Row({space:10}){ ForEach(this.popularMovies,(img:Resource,index)=>{ Image(img) .width(124) .height(180) .objectFit(ImageFit.Contain) .borderRadius(10) .onClick(()=>{ router.pushUrl({ url:'pages/Info' }) }) }) } } .scrollable(ScrollDirection.Horizontal) .scrollBar(BarState.Off) .width('100%') } } .padding({left:12,right:12}) } .width('100%') .height('100%') .backgroundColor('rgb(6,4,31)')}@Builder ListHeader(title:string,isRight:boolean){ Row(){ Text(title) .fontColor(Color.White) .fontSize(15) if(isRight){ Text('查看全部') .fontColor(Color.White) .fontSize(11) } } .alignItems(VerticalAlign.Center) .width('100%') .height(40) .justifyContent(FlexAlign.SpaceBetween) .onClick(()=>{ router.pushUrl({ url:'pages/MovieList' }) })} 页面开发就说这么多,下面进入视频处理部分,这里使用的本地视频,首先把视频文件拖进rawfile文件夹中,然后使用video组件播放视频: Video({ src: $rawfile('movie.mp4'), controller: this.controller}) .width('100%') .height(this.isLandscapeStart?'100%':this.screen_width * 9 / 16) .autoPlay(true) .controls(false) .objectFit(ImageFit.Cover) .loop(false) Video组件提供了工具栏和全屏方法,不过效果不好,非常丑陋,实际项目中我们通常需要自定义工具栏,全屏也通过设置组件的宽高尺寸来实现,我这里就简单添加一个全屏按钮,下面演示一下如何对视频进行横竖屏切换。 设置横屏,也就是全屏模式的步骤分别是先获取到当前窗口,然后将状态栏、导航栏隐藏,再将窗口横屏,相关代码如下: changeOrientation() { // 获取UIAbility实例的上下文信息 let context = getContext(this); // 调用该接口手动改变设备横竖屏状态(设置全屏模式,先强制横屏,再加上传感器模式) window.getLastWindow(context).then((lastWindow) => { if (this.isLandscapeStart) { // 设置窗口的布局是否为沉浸式布局 lastWindow.setWindowLayoutFullScreen(true).then(() => { // 设置窗口全屏模式时导航栏、状态栏的可见模式 lastWindow.setWindowSystemBarEnable([]); // 设置窗口的显示方向属性,AUTO_ROTATION_LANDSCAPE表示传感器自动横向旋转模式 lastWindow.setPreferredOrientation(window.Orientation.AUTO_ROTATION_LANDSCAPE, () => { this.isLandscape = !this.isLandscape; }); }); } }); } 退出全屏时将上面代码反向操作就行了。
dev.to
March 23, 2025 at 12:21 PM