I referenced this post: Header issues
Has anyone figured out a way using conditional Angular styling to modify UI-boostrap? Neither ng-class, ngClass, ng-style nor any of the other methods mentioned in this post conditional styling seem to work.
Hoping to use the Bootstrap UI. Should I use a Bootstrap styler or modify the css directly?
Apologies for the newbie question.
Related
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 am looking for a option to hide the header globally. So, is there any way to add styles globally in sharepoint framework.
Note: Opted Reactjs to build we parts.
You could create a Application Customizer to hide the element for modern view globally.
Use jQuery in SPFx
My test result.
$(document).ready(() => {
$("span:contains('Office 365')").css('display','none');
})
I would inject a custom CSS stylesheet using an application customerizer.
Here the code to inject your custom CSS:
https://github.com/hugoabernier/react-application-injectcss
Here is an article I wrote that explains how to do it:
https://tahoeninjas.blog/2018/05/08/inject-custom-css-on-sharepoint-modern-pages-using-spfx-extensions/
The article explains why you should be careful with such customizations.
Let me know if you need help with the CSS.
I'm not using any bootstrap styles. I'm customizing everything completely. It's fairly straight forward to animate in, because the $modal uses .fade.in. I was able to override those styles and it works great. But how does the modal animate out? I see no classes being applied or removed. It is simply removed from the DOM instantly.
How can I customize the animate out event? Does it use CSS classes? Does it use JS?
It seems this question is very similar: https://stackoverflow.com/questions/20595622/how-to-slideout-a-bootstrap-modal-in-angular. Unfortunately there is not a solution.
I'm using Angular UI Bootstrap accordion with templates. I'm wanting to know how I can replace the template that's injected by the accordion directive without modifying the UI library itself? Can I override the injection of the template somehow?
Thanks in advance
Sean
I ended up just adding a template after the bootstrap library. From there I was able to do anything I wanted. See this post
Yes you can but you need to override the class that the angular ui library have. In the css files, but not only, you can find a very precise explanation of every class that the accordion uses, if rewrite the class of your interest in another css file, your attribute override the previous one.
I'm looking for a plugin for a modal directive in Angular but there is a requirement not to use the Bootstrap CSS. Angular-UI looks nice but obviously depends on Bootstrap. Any pointers?
In case of Angular-UI you can define your own templates and in case of CSS you can for sure use your own files.
Here are standard templates for modal. The only dependencies on Bootstrap I found are: modal and modal-backdrop so just rename them for your needs or add them to your CSS to get custom styling.
Btw: Angular-UI is modular so you can just use these directives which you really need.
I don't know existing plugin to achieve this without Bootstrap (I use Angular-UI), but you can easily create your own directive using jQuery UI modal.
There are lots of tuto on the internet to create directive for jQuery UI.
I have found a JSFiddle in this Google Group (you have to follow the link in the answer of January 4). User has made a simple directive based on jQuery.
I think it will put you on the right way.