I have MEAN.js installed, along with an Angular theme that I would like to replace the default MEAN Angular theme with, in looking at the structure of each, I'm having a hard time figuring out how to implement it, does anyone have an approach or perhaps a link to a tutorial for this.
If you're referring to the Bootstrap theme, you can place the theme files in a convenient directory and then update the config/assets/default.js file with the path to the theme files.
Related
I have to include a third party widget into my React+TS app.
The widget is shipped in a minified js file and according to their documentation it can be included in a script tag or through e.g. requireJS.
What I cannot wrap my head around is that - as far as I understand - both methods above include the widget at runtime as window.Widget. However, I would like to interact with the widget from my TypeScript code as it exposed different methods.
Is that at all possible? Obviously, I could include my own logic outside TS/React, but I'd prefer to keep it inside.
If that's not possible, is there another way I could communicate with the widget other than maybe through my server?
Apologies if this is a stupid question, I'm a bit stuck right now!
Ok, so I feel pretty stupid. It turns out, I can download the minified js file and just import it into my project. It doesn't have any types, but it works.
import * as Widget from "../lib/widget.min";
I want to download one of the free bootstrap templates and add said template to my react app. I tried reading some of the documents but I can't find any documentation on integrating these free templates with react.
I did an npm install for the template I liked but I'm not sure what to do next. I just have the template in my node_modules directory.
I took what was in the body of the html file in the template and threw it in the return for my app.js. Added the css and vendor folder. Then I tried to import the templates css file to my app.js as well as change what was needed in my index.html file. Some of it worked. Other parts didn't.
Just looking to properly integrate these nice looking templates into my react projects.
Any help would be greatly appreciated!
The issue is these templates are built with Bootstrap in mind not React. These templates were created using regular HTML, CSS, JS, jQuery, etc.. and won't work out of the box for a React application. So in order to get one of these templates to work, within the context of React, one will have make manual changes to numerous parts of said template.
For example, in addition to grabbing the pieces of the template desired for your React application one will have to change numerous attributes listed within the HTML pages provided by the template. This is because in React you can't use keywords reserved for JavaScript in JSX.
So what does this mean?
You'll have to change the class attributes in the HTML to className for your CSS style rules to take effect from the template. onchange becomes onChange, onsubmit becomes onSubmit, etc...
The standard is to camelCase reserved JavaScript keywords in JSX.
You can definitely get this template to work in React it will just involve some manual tweaking on your end. However, if you want a template to work out of the box for React I would look into a free template built with React in mind.
Hopefully that helps!
I'm new to Sharepoint Framework but I used the 'yo #microsoft/sharepoint' command to create a new React/SPFx project. However, in doing so it seems that I don't have access to some of the CSS classes available in OfficeUI Fabric. For example if I try to create a typical grid layout, the ms-Grid-row and ms-Grid-col classes work as expected but the sizing utility classes do not (ms-sm6, ms-lg6). Other fabric classes work as well such as ms-bgColor-neutralLight, ms-font-xl, and ms-fontWeight-semibold ... so a portion of that styling is coming through.
If I add a link reference to the workbench.html file pointing to the CDN of fabric.css I get those classes working again....but that is not a solution since that file is just a temporary file build for testing at compile time.
Is there something else that needs to be done to include fabric.css (or fabric.min.css) in my project?
I am running into the same issue. Yeoman generated SPFX webpart (React) for an on premises instance. Digging into the node module, I found the classes didn't match the documentation. Where the documentation would say to use ms-md6, the css file has ms-u-md6. Seems like all of the layout classes follow this pattern of ms-u- rather than just ms-... Adding the -u to the className is now giving me appropriately sized columns.
The path to the file I found the classes in is: .../node_modules/office-ui-fabric/dist/css/fabric.css (YMMV)
I have an extjs application which I embed into an existing HTML template with js plugins/css etc.
Im having CSS conflicts between my template styles and ext's. As a simple solution im wondering whether I can tell ext to only use its own css file when creating its components. I've implemented the following setting before I load my application:
Ext = {
buildSettings:{
"scopeResetCSS": true // Thanks, but I'll do my own scoping please
}
};
Which works to some degree, but the plugins css files are overriding certain ext components (form fields, alignment issues etc).
This is the first time i've tried integrating an ext application into a html template so my knowledge is pretty limited.
Thanks in advance
As far as I know, there is no way to scope CSS in a single page, I wonder how you did it. If you want to avoid conflicts, I'm afraid that you'll have to do some refactoring.
Some advices :
Build your CSS rules with the ExtJS file loaded in the page, which means that you are currently working with the final environnement. Moreover, you can use their own reset rules.
Do not use tag selectors (div, span, input...) - which apply to every element in your page including ExtJS ones - unless the targeted element never host any ExtJS component.
Add a namespace to your own selectors (#my-id, .my-class) as ExtJS does (.x-button, .x-container).
Another solution would be to sandbox ExtJS with iframes, but it depends on the nature of your project. I don't have enough informations to help you more than that.
We have bought an admin theme from Themeforest for our web application, which is being built using CakePHP2 framework. I know the basic way of integrating this theme into the cakephp framework, where we put the respective JS, CSS files under webroot folder and create layout to includes these files.
This method does give me desired results but I feel this is not the best way to integrate a theme in a MVC architecture. Because it does not work always for example, if i want to use just a look and feel of the downloaded theme and use Cakephp's pagination method it does not work seemlessly and i then need to keep tweaking the UI. Thus, I think there must be a best practice to integrate such themes. Can anyone suggest me if there is any better way of doing this integration?
I tried to search for such articles on the internet but did not find any suitable ones.Can you point me to one if you know or suggest any better way?
Thank you in Advance.
It sounds like you have integrated your purchased theme correctly.
Because the theme you purchased was not created as as CakePHP theme, the CSS is unlikely to match. This is what is causing your issue with some features not displaying correctly, such as CakePHP's pagination... the pagination helper ads HTML to the view in CakePHP that will more than likely not be covered by your general html theme.
For any instances you find that do not look like you expect, you will have to manually add CSS to your themes CSS file, or if your lucky just rename the CSS styles already in place.
Sorry, there is no easy way to fix this except manually integrating the missing CSS/HTML.
Good luck.