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>
Related
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.
How may we reference baseUrl in the <style> section of a vue.js SFC?
/src/views/Home.vue
<style scoped>
#import url(<%= BASE_URL %>static/required_styles.css); // does not work
</style>
Directory structure:
|--public
| --static
| --required_styles.css
|--src
| --views
| --Home.vue
It's not clear how to do this from the docs on static asset handling:
https://cli.vuejs.org/guide/html-and-static-assets.html#the-public-folder
The public folder is for files that you want to be served directly on the server without going through webpack. An example would be minified css who's styles you use. In that case you would just add the css path to vue.config.js or the header of index.html. If you are importing in the styles tag the css will be pull through your build process (e.g. webpack) when the component is compiled. This means you should not put the .css file in the public folder, and should use a relative path for the import.
I've a custom theme under app/theme/AcmeTheme. I have the theme working and I can define my own templates under views or override template for other Bundles. The problem is that I can not figure out how to add a custom CSS file inside my theme.
So fat I've tried:
AcmeTheme/public/style.css
AcmeTheme/web/style.css
But after running assets:install and sylius:theme:assets:install the file is not copied. I have read the documentation multiple times and I can still not get it to work.
Place your style.css in app/themes/AcmeTheme/SyliusShopBundle/public/ and run sylius:theme:assets:install. Now your style.css should be available in web/bundles/_themes/AcmeTheme/template/syliusshop/ and you can include it in the html.twig with <link rel="stylesheet" href="{{ asset('bundles/syliusshop/styles.css') }}">
Solution with assets in app/themes/AcmeTheme/web/assets/ doesn't work for me. Only way to add custom assets is via app/themes/AcmeTheme/SyliusShopBundle/public/ which is pretty odd.
I'm trying to make a simple page with bootstrap and glypicons in jsf 2.2. I've included webjar's bootstrap dependency (and opening the jar I can see the fonts file are present).
When deploying the app to wildfly, bootstrap css works correctly, but icons shown are horrible (like a default font or something). Looking at the network tab in the browser, I only see 404 errors:
http://localhost:8080/proto/javax.faces.resource/bootstrap/3.1.1/fonts/glyphicons-halflings-regular.woff 404
http://localhost:8080/proto/javax.faces.resource/bootstrap/3.1.1/fonts/glyphicons-halflings-regular.ttf 404
I tried including the other dependency (bootstrap-glypicons) and I only get the 404 errors twice. What am I missing?
This is how I'm including boostrap, which works correctly for css:
<h:outputStylesheet library="webjars" name="bootstrap/3.1.1/css/bootstrap.min.css" />
And this is how I'm using the css classes:
<button><span class="glyphicon glyphicon-minus"></span></button>
You should use <link> tag instead of <h:outputStylesheet>
eg.
<link rel="stylesheet" type="text/css" media="all" href="webjars/bootstrap/3.1.1/css/bootstrap.min.css"/>
--- UPDATE
This happen because ResourceHandler in JSF add library value (webjars) to the end of URI as a parameter:
faces/javax.faces.resource/bootstrap/3.1.1/css/bootstrap.min.css?ln=webjars
in bootstrap.min.css CSS there are such references to files:
url('../fonts/glyphicons-halflings-regular.woff') format('woff'), url('../fonts/glyphicons-halflings-regular.ttf') format('truetype'),
so if you want to use <h:outputStylesheet> you can write own ResourceHander or you can edit bootstrap.min.css and fix paths to glyphicons-halflings-regular.* files
In my opinion is better to use standard html tag <link> instead of <h:outputStylesheet> because JSF component tree will be smaller and it act on performance. Inside bootstrap.min.css there is no EL so there is no need to use <h:outputStylesheet>
Small update: webjars has JSF specific versions of several CSS libraries, in case of the bootstrap CSS the following will work just fine:
<h:outputStylesheet library="webjars" name="bootstrap/3.3.5/css/bootstrap-jsf.css" />
Note the -jsf suffix.
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