Can some know how to customize blazor components of matblazor? - asp.net-core

I want to customize the input field textbox height more minimal and its font style. I used matblazor component to my project. Can someone know how I can solve this problem from root CSS or something like that?

Just include an additional CSS file in the _Host.cshtml like
...
<head>
...
<link rel="stylesheet" href="my-custom-matblazor-styles.css" />
</head>
or in your .razor file like this
<link rel="stylesheet" href="my-custom-matblazor-styles.css" />
to override the CSS rules of MatBlazor.
I would favor the latter as you need the CSS file only when you are actually using a MatBlazor component on a page.
Do not mangle with the original CSS files as it will result in a complete chaos when a new version of MatBlazor is released.

Related

customising variables in Bootstrap 4 with SASS in .NET core

I'm used to working on .NET MVC. I'm trying to learn .NET Core now and want to include Bootstrap with SASS. I'm completely new to the setup side of things and can't get it properly up and running.
I have set up my .NET core project and I've managed to install bootstrap 4 with libman. After I'd done it, I read that it's preferred to do it with npm but it seems to be fine.
All the defaults work as expected.
Now I'm trying to make custom changes and that's where it gets troublesome. Just to see if changes are applied, I've changed the primary colour code in the _variables file but nothing changes. I've also tried to create a custom scss file to override the others but again, it doesn't work. I'm sure it's me doing something wrong but I'm not sure what.
my file structure looks like this. It was created when I installed bootstrap 4:
file structure top
file structure bottom
the only thing I changed was adding the site.scss file for customisation.
_Layout.cshtml
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<environment include="Development">
<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.css" />
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css">
</environment>
</head>
My custom site.scss:
$orange: #d95700;
#import "bootstrap";
$theme-colors: ( "primary": $orange );
When I make changes to the bootstrap.css they either show up or they get overridden by the _reboot.scss, depending on what it is. e.g. I can change the body bg color to red.
If anyone needs me to add any more information, I'm happy to do that.
Libman merely pulls in the libraries statically. Changing any of the SCSS files isn't going to cause the CSS file you're referencing to be updated. For that to happen, you'll need to set up a build of the SCSS with something like Webpack or Gulp.
However, if you want to actually modify the SCSS, then you should not rely on libman or even npm to pull in Bootstrap for you. Both of these will update the library in place, overriding any of your changes. Instead, you should simply download Bootstrap directly or you can include it in your project in a more updatable way by forking the Bootstrap project on GitHub and then including that in your repo as a remote. Then, you can commit changes out to your fork, and merge updates from the Bootstrap official repo into your fork.

How to add cdn css file to Vue Cli 3 project?

I'm trying to include a cdn external css file in my vue-cli-3 project, so I added the css file in the public/index.html file like this:
<link rel="stylesheet" href="http://mycssfile.css">
But the css is not included in the generated index.html file. this used to work in vuejs2, I don't understand why it doesn't work with vuejs3. Any idea what the problem is? thanks
It is simple.
On your main.vue add the following
<style>
#import "https://stackpath.bootstrapcdn.com/bootstrap/4.1.2/css/bootstrap.min.css";
</style>

Bootstrap theme not displaying correctly at all

I am building a site based off of Bootstrap Carousel theme... unfortunately nothing is working when I copy the index and css file into my directory. Are there other files aside from the CSS that need to be in the same directory? like the glyphicons and all the buttons. It's literally just displaying the html... no carousel or anything.
nothing needs to be in same directory! just check you have the right path to the files! and all are loaded. As well as include the bootstrap links
Something like this :
<head>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>

CSS customization in Octostrap3

I have an Octopress blog with an installed Octostrap3 theme. Everything works fine so far.
But I've been looking for the last days and I'm not able to find the responsible css files in Octostrap3 to change the colors for my Octopress blog.
Could anybody tell me which css (or scss) files I need to edit?
Ok, i've found a solution that works for me.
tomordonez' hint didn't help in my case (but thank you anyway), because there was just an screen.css in /source/stylesheets, no style.css.
If you have octostrap3 installed, you can use any bootstrap theme. To change the theme, you just have to edit the /source/_includes/custom/head.html and insert the path to the css file for your theme.
I placed my theme-css-file in /source/assets/deg0nz/, so i changed the head.html to:
<link href="{{ root_url }}/assets/deg0nz/bootstrap.min.css" rel="stylesheet" type="text/css">
<link href="{{ root_url }}/stylesheets/screen.css" media="screen, projection" rel="stylesheet" type="text/css">
I have chosen a theme from bootswatch and customized it with their customization procedure. So in the end i just had to change the bootswatch.less, the variables.less and the bootstrap.css in the bootswatch-theme folder and create the min-files.
Instead of doing this you can use any bootstrap.css and place it's path in /source/_includes/custom/head.html like i described above.
Try source/stylesheets/style.css

apply stylesheet to web user control

I want to apply styles to one webusercontrol
I have tried with
<link rel="Stylesheet" type="text/css" href="<%=ResolveUrl("~/Styles/ascxStyles.css") %>" />
but i'm not able to apply styles to user control.
Thanks in advance
Try Something Like
href="~/Styles/StyleSheet.css"
where ~/ is Root directory of the application
and add runat="server"
Or just Drag Your css On your control it will automatically create appropriate path
I think your ResolveUrl is wrong. you can use this in your usercontrol or in that pages which uses this usercontrol :
<link rel="stylesheet" type="text/css" href="../Styles.css" media="screen" />
As far as I know, you can also use the css file
which you have added to your MasterPage.
So no need to add css file to Web User Control again.