Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(react-image): update styles to not use CSS shorthands #20818

Merged
merged 1 commit into from
Nov 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
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
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