fluentui icon indicating copy to clipboard operation
fluentui copied to clipboard

Using office-ui-fabric-react styles in my component

Open aslanovsergey opened this issue 8 years ago • 9 comments

Describe the issue:

I am trying to create my own component using an example as blueprint https://github.com/OfficeDev/office-ui-fabric-react/tree/master/packages/office-ui-fabric-react/src/components/pickers/TagPicker

The problem is with scss file https://github.com/OfficeDev/office-ui-fabric-react/blob/master/packages/office-ui-fabric-react/src/components/pickers/TagPicker/TagItem.scss

I can't find a replacement for this line @import '../../../common/common';

and if I don't import it I can't use these

@include focus-border();

@include high-contrast {
   border: 1px solid WindowFrame;
}

aslanovsergey avatar Mar 15 '18 08:03 aslanovsergey

@dzearing Is there a good way to access common styles from the package?

michaelangotti avatar Mar 15 '18 21:03 michaelangotti

@aslanovsergey When you say create your own component, I assume this is in your own repo? and you have sass building and such.

You should be able to import the same file from your sass.

dzearing avatar Mar 22 '18 17:03 dzearing

I mean React component. This is a SharePoint framework web part solution. I took this example https://github.com/OfficeDev/office-ui-fabric-react/tree/master/packages/office-ui-fabric-react/src/components/pickers/TagPicker copied and customized it slightly.

The problem is I can't find this file in office-ui-fabric-react npm package to use it in my sass file @import '../../../common/common';

aslanovsergey avatar Mar 26 '18 09:03 aslanovsergey

Could you say please where I can find this mixins

@include focus-border();

    @include high-contrast {
      border: 1px solid WindowFrame;
    }

aslanovsergey avatar Mar 28 '18 07:03 aslanovsergey

This issue has been automatically marked as stale because it has not activity for 60 days. It will be closed if no further activity occurs within 14 days of this comment. Thank you for your contributions to Fabric React! Why am I receiving this notification?

stale[bot] avatar Jul 09 '18 21:07 stale[bot]

This issue has been automatically closed because it has not had recent activity after being marked as stale. If you belive this issue is still a problem or should be reopened, please reopen it! Thank you for your contributions to Fabric React! Why am I receiving this notification?

stale[bot] avatar Jul 23 '18 22:07 stale[bot]

Hi @aslanovsergey are you still stuck on this? You can get the mixin from office-ui-fabric-core but our general guidance now is to move to JS styling. Let me know if you need a concrete example.

cliffkoh avatar Jul 25 '18 22:07 cliffkoh

Hi @cliffkoh, as you mentioned the general guidance is now to move to JS styling. I recently saw this video, it shows, starting from minute 38, how to use the core styles by importing mixins. Are there already JS mixins for the core styles available?

Wezea avatar May 23 '19 03:05 Wezea

Of the top of my head, yes. @Vitalius1 is much more tuned-in here though and should be able to provide a more definitive guidance.

cliffkoh avatar May 23 '19 04:05 cliffkoh