Skip to content

Commit

Permalink
fix(react-image): update styles to not use CSS shorthands
Browse files Browse the repository at this point in the history
  • Loading branch information
layershifter committed Nov 29, 2021
1 parent b8537fb commit 55567fe
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 15 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "prerelease",
"comment": "update styles to not use CSS shorthands",
"packageName": "@fluentui/react-image",
"email": "olfedias@microsoft.com",
"dependentChangeType": "patch"
}
14 changes: 7 additions & 7 deletions packages/react-image/src/components/Image/useImageStyles.ts
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
import { mergeClasses, makeStyles } from '@fluentui/react-make-styles';
import { shorthands, mergeClasses, makeStyles } from '@fluentui/react-make-styles';
import type { ImageState } from './Image.types';

export const imageClassName = 'fui-Image';

const useStyles = makeStyles({
root: theme => ({
borderColor: theme.colorNeutralStroke1,
borderRadius: theme.borderRadiusNone,
...shorthands.borderColor(theme.colorNeutralStroke1),
...shorthands.borderRadius(theme.borderRadiusNone),

boxSizing: 'border-box',
display: 'inline-block',
}),
rootBordered: theme => ({
borderStyle: 'solid',
borderWidth: theme.strokeWidthThin,
...shorthands.borderStyle('solid'),
...shorthands.borderWidth(theme.strokeWidthThin),
}),
rootCircular: theme => ({
borderRadius: theme.borderRadiusCircular,
...shorthands.borderRadius(theme.borderRadiusCircular),
}),
rootRounded: theme => ({
borderRadius: theme.borderRadiusMedium,
...shorthands.borderRadius(theme.borderRadiusMedium),
}),
rootShadow: theme => ({
boxShadow: theme.shadow4,
Expand Down
2 changes: 1 addition & 1 deletion packages/react-image/src/stories/ImageBlock.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import { Image } from '../Image'; // codesandbox-dependency: @fluentui/react-image ^9.0.0-beta
import { Image } from '../Image';

export const Block = () => (
<>
Expand Down
2 changes: 1 addition & 1 deletion packages/react-image/src/stories/ImageBordered.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import { Image } from '../Image'; // codesandbox-dependency: @fluentui/react-image ^9.0.0-beta
import { Image } from '../Image';

export const Bordered = () => (
<div>
Expand Down
4 changes: 2 additions & 2 deletions packages/react-image/src/stories/ImageDefault.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from 'react';
import type { ImageProps } from '../Image'; // codesandbox-dependency: @fluentui/react-image ^9.0.0-beta
import type { ImageProps } from '../Image';
import type { ArgTypes, Parameters } from '@storybook/react';
import { Image } from '../Image'; // codesandbox-dependency: @fluentui/react-image ^9.0.0-beta
import { Image } from '../Image';

export const Default = (props: ImageProps) => {
return <Image {...props} />;
Expand Down
2 changes: 1 addition & 1 deletion packages/react-image/src/stories/ImageFallback.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import { Image } from '../Image'; // codesandbox-dependency: @fluentui/react-image ^9.0.0-beta
import { Image } from '../Image';

export const Fallback = () => (
<div style={{ display: 'flex', gap: 8 }}>
Expand Down
2 changes: 1 addition & 1 deletion packages/react-image/src/stories/ImageFit.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import { Image } from '../Image'; // codesandbox-dependency: @fluentui/react-image ^9.0.0-beta
import { Image } from '../Image';

export const Fit = () => (
<>
Expand Down
2 changes: 1 addition & 1 deletion packages/react-image/src/stories/ImageShadow.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import { Image } from '../Image'; // codesandbox-dependency: @fluentui/react-image ^9.0.0-beta
import { Image } from '../Image';

export const Shadow = () => <Image shadow src="https://via.placeholder.com/300x300" />;
Shadow.parameters = {
Expand Down
2 changes: 1 addition & 1 deletion packages/react-image/src/stories/ImageShape.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import { Image } from '../Image'; // codesandbox-dependency: @fluentui/react-image ^9.0.0-beta
import { Image } from '../Image';

export const Shape = () => (
<div style={{ display: 'flex', gap: 8 }}>
Expand Down

0 comments on commit 55567fe

Please sign in to comment.