Skip to content

Commit 413556a

Browse files
committed
Use tailwind classes instead of style where possible
1 parent dfeffca commit 413556a

2 files changed

Lines changed: 6 additions & 10 deletions

File tree

src/client/GameInfoModal.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,18 +107,16 @@ export class GameInfoModal extends LitElement {
107107
}
108108
const isUnusualThumbnailSize =
109109
info.config.gameMap === GameMapType.AmazonRiver;
110-
const objectFitStyle = isUnusualThumbnailSize
111-
? "object-fit: cover; object-position: center;"
112-
: "";
113110
return html`
114111
<div
115112
class="h-37.5 flex relative justify-between rounded-xl bg-blue-600 items-center"
116113
>
117114
${this.mapImage
118115
? html`<img
119116
src="${this.mapImage}"
120-
class="absolute place-self-start col-span-full row-span-full h-full rounded-xl mask-[linear-gradient(to_left,transparent,#fff)]"
121-
style="${objectFitStyle}"
117+
class="absolute place-self-start col-span-full row-span-full h-full rounded-xl mask-[linear-gradient(to_left,transparent,#fff)] ${isUnusualThumbnailSize
118+
? "object-cover object-center"
119+
: ""}"
122120
/>`
123121
: html`<div
124122
class="place-self-start col-span-full row-span-full h-full rounded-xl bg-gray-300"

src/client/PublicLobby.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,6 @@ export class PublicLobby extends LitElement {
116116
const mapImageSrc = this.mapImages.get(lobby.gameID);
117117
const isUnusualThumbnailSize =
118118
lobby.gameConfig.gameMap === GameMapType.AmazonRiver;
119-
const objectFitStyle = isUnusualThumbnailSize
120-
? "object-fit: cover; object-position: center;"
121-
: "";
122119

123120
return html`
124121
<button
@@ -136,8 +133,9 @@ export class PublicLobby extends LitElement {
136133
? html`<img
137134
src="${mapImageSrc}"
138135
alt="${lobby.gameConfig.gameMap}"
139-
class="place-self-start col-span-full row-span-full h-full -z-10 mask-[linear-gradient(to_left,transparent,#fff)]"
140-
style="${objectFitStyle}"
136+
class="place-self-start col-span-full row-span-full h-full -z-10 mask-[linear-gradient(to_left,transparent,#fff)] ${isUnusualThumbnailSize
137+
? "object-cover object-center"
138+
: ""}"
141139
/>`
142140
: html`<div
143141
class="place-self-start col-span-full row-span-full h-full -z-10 bg-gray-300"

0 commit comments

Comments
 (0)