Into my laravel 8 app with tailwindcss2/inertiajs I try to apply tailwindcss2 styles which have a lot of icons like :
<i data-feather="chevron-down"></i></div>
I do not see any icons, though I applyed all css files from source templates.
It does not look like package
"#fortawesome/fontawesome-free": "^5.15.4",
which I use in my laravel apps
Which packages/fonts have I to add to my app to see these icons?
In package.json I have :
"devDependencies": {
"#inertiajs/inertia": "^0.10.0",
"#inertiajs/inertia-vue3": "^0.5.1",
"#inertiajs/progress": "^0.2.6",
"#tailwindcss/forms": "^0.2.1",
"#tailwindcss/typography": "^0.3.0",
"#vue/compiler-sfc": "^3.0.5",
"axios": "^0.21",
"laravel-mix": "^6.0.6",
"lodash": "^4.17.19",
"postcss": "^8.1.14",
"postcss-import": "^12.0.1",
"tailwindcss": "^2.0.1",
"vue": "^3.0.5",
"vue-loader": "^16.1.2"
},
"dependencies": {
"moment-timezone": "^0.5.34"
}
Thanks!
Using Font-Awesome works well on standard <i> HTML with classes.
Perhaps give this a try:
<i class="chevron-down"></i>
If you are looking for the feather icon JS, you may be crossing the streams here, that may be a separate package of SVG icons (unpkg.com) that needs to be loaded as a script.
E.g.
<script src="https://unpkg.com/feather-icons"></script>
Maybe you havn't initialized feather icons by:
feather.replace()
// init feather icons
feather.replace()
<script src="https://unpkg.com/feather-icons#4.28.0/dist/feather.min.js"></script>
<!-- example icons -->
<i data-feather="eye"></i>
<i data-feather="heart"></i>
<i data-feather="feather"></i>
BTW. fontAwesome uses different icon class names. So you should't encounter any conflicts.
Related
When I use Scss in rollup, and When I build project then there is a error:
[!] Error: Unexpected character '#' (Note that you need plugins to import files that are not JavaScript)
components/styles/index.scss (3:0)
1: #import 'variables';
I tried some methods but not success, such as rollup-plugin-postcss or rollup-plugin-scss. And I changed sass to node-sass, but another problem appear because I used a syntax like $spacer / 2.
This is my package.json
"devDependencies": {
"#babel/core": "^7.18.6",
"#babel/preset-env": "^7.18.6",
"#babel/preset-react": "^7.18.6",
"#babel/preset-typescript": "^7.18.6",
"#rollup/plugin-babel": "^5.3.1",
"#rollup/plugin-commonjs": "^22.0.1",
"#rollup/plugin-json": "^4.1.0",
"#rollup/plugin-node-resolve": "^13.3.0",
"#rollup/plugin-replace": "^4.0.0",
"#types/classnames": "^2.3.1",
"#types/react": "^17.0.0",
"#types/react-dom": "^17.0.0",
"#types/react-transition-group": "^4.4.4",
"cross-env": "^7.0.3",
"node-sass": "6.0.1",
"postcss": "^8.4.14",
"react": "^17.0.2",
"react-dom": "17.0.2",
"rollup": "^2.76.0",
"rollup-plugin-css-porter": "^1.0.2",
"rollup-plugin-peer-deps-external": "^2.2.4",
"rollup-plugin-postcss": "^4.0.2",
"rollup-plugin-postcss-retain-sass-data": "^2.0.3",
"rollup-plugin-scss": "^3.0.0",
"rollup-plugin-styles": "^4.0.0",
"rollup-plugin-terser": "^7.0.2",
"rollup-plugin-typescript2": "^0.32.1",
"sass": "^1.53.0",
"typescript": "^4.7.4"
}
This is index.scss
#import 'variables';
// layout
#import 'normalize';
// mixin
#import './mixins';
// animation
#import './animation';
// alert
#import '../Alert/style';
Is there some methods to solve this problem?
I was having the same issue with importing css file, the error was [!] Error: Unexpected character '#' (Note that you need plugins to import files that are not JavaScript). as rollup is suggesting to install the required plugin, I installed rollup-plugin-import-css and now it's working fine.
In your case which your file is sass you can try rollup-plugin-sass
I have a default Laravel project which is scaffold with Bootstrap and Vue.js.
Having considered to use Laravel JetStream Livewire, I am going to remove bootstrap because Laravel JetStreal Livewire is using TailwindCSS and we can not use both Bootstrap and TailwindCSS together.
"devDependencies": {
"#tailwindcss/forms": "^0.3.1",
"#tailwindcss/typography": "^0.4.0",
"alpinejs": "^2.7.3",
"axios": "^0.21",
"bootstrap": "^4.6.0",
"jquery": "^3.6",
"laravel-mix": "^6.0.6",
"lodash": "^4.17.19",
"popper.js": "^1.16.1",
"postcss": "^8.1.14",
"postcss-import": "^14.0.1",
"resolve-url-loader": "^3.1.2",
"sass": "^1.32.11",
"sass-loader": "^11.0.1",
"tailwindcss": "^2.0.1",
"vue": "^2.6.12",
"vue-template-compiler": "^2.6.12"
}
I installed Bootstrap using php artisan ui boostrap.
Is there any standard way to remove bootstrap so that I can use only TailwindCSS in my project?
bootsrtap only adds javascript and css files. So first remove the libraries bootsratp,jquery and popper.js. To remove bootsrtap run command:
npm uninstall bootstrap
then in resources/js/bootstrap.js remove:
window.Popper = require('popper.js').default;
window.$ = window.jQuery = require('jquery');
require('bootstrap');
in resources/sass/app.scss remove:
// Variables
#import 'variables';
// Bootstrap
#import '~bootstrap/scss/bootstrap';
you can also delete file resources/sass/_variables.scss. Now run npm run dev/production.
you can also delete laravel/ui views if you've published them.
By doing these steps your laravel package will not depend on bootstrap, unless bootstrap is added by cdn somewhere.
Now you can add any other scaffolding you wish.
tried to show component in my blade but it still not working.i used laravel 7
there is my vue
<template>
<h3>Option Values</h3>
</template>
<script>
export default {
name: "attribute-values",
props: ['attributeid'],
}
</script>
there is how i call it in my view
<div class="tab-pane" id="values">
<attribute-values :attributeid="{{ $attribute->id }}"></attribute-values>
</div>
i import it in js file
Vue.component('attribute-values', require('./components/AttributeValues.vue').default);
there is my package.json file
"devDependencies": {
"axios": "^0.19",
"bootstrap": "^4.0.0",
"cross-env": "^7.0",
"jquery": "^3.2",
"laravel-mix": "^5.0.1",
"lodash": "^4.17.19",
"popper.js": "^1.12",
"resolve-url-loader": "^2.3.1",
"sass": "^1.20.1",
"sass-loader": "^8.0.0",
"vue": "^2.5.17",
"vue-template-compiler": "^2.6.10"
},
"dependencies": {
"vue-swal": "^0.1.0",
"vue-js-modal": "^1.3.26"
}
what should i do .thank you in advance.
i run npm run dev and npm run watch many times. my file js is generated in public folder so there is no problem. but component still not showed up.
i solved it. all what i did is i separate div id=app from my content.because tags don't match with vue.and i add vue.use(component) like below in my js file:
import AttributeValues from './components/AttributeValues.vue'
Vue.use(AttributeValues);
Vue.component('attribute-values', require('./components/AttributeValues.vue').default, {
name: 'attribute-values'
});
hope that it solve someone's problem.
I have a project built with Laravel and Vue.JS (Using Bootstrap-Vue also). Everything works as it should on all browsers including Edge. But as you guessed it, not in IE11.
I have tried various configurations of using babel/polyfills.
In my webpack.mix.js I have the following code:
let mix = require('laravel-mix');
require('laravel-mix-polyfill');
mix.js('resources/js/app.js', 'public/js')
.sass('resources/sass/app.scss', 'public/css')
.polyfill({
enabled: true,
useBuiltIns: "entry",
targets: { "firefox": "50", "ie": 11 }
});
I have the following dependencies in my package.json file:
"devDependencies": {
"#babel/polyfill": "^7.8.3",
"axios": "^0.18.1",
"bootstrap": "^4.3.1",
"cross-env": "^5.1",
"laravel-mix": "^4.0.7",
"laravel-mix-polyfill": "^1.1.1",
"lodash": "^4.17.5",
"mutationobserver-shim": "^0.3.3",
"node-sass": "^4.13.1",
"popper.js": "^1.12",
"portal-vue": "^2.1.4",
"resolve-url-loader": "^2.3.1",
"sass": "^1.15.2",
"sass-loader": "^7.1.0",
"vue": "^2.6.10",
"vue-template-compiler": "^2.6.10"
},
"dependencies": {
"#chenfengyuan/vue-qrcode": "^1.0.1",
"bootstrap-vue": "^2.2.0",
"current-device": "^0.9.1",
"intersection-observer": "^0.7.0",
"lottie-vuejs": "0.3.6",
"moment": "^2.24.0",
"v-mask": "^2.0.2",
"vue-autosuggest": "1.8.3",
"vue-js-toggle-button": "^1.3.3",
"vue-recaptcha": "^1.2.0",
"vue-social-sharing": "^2.4.7",
"vue2-flip-countdown": "^0.9.3",
"vuelidate": "^0.7.4"
}
And my app.js file has this at the top as recommended by Bootstrap-Vue documentation:
import '#babel/polyfill'
import 'intersection-observer' // Optional
I have also tried adding the script tag from polyfill.io in the head section of my website.
All result in a blank screen with a SCRIPT1002 Syntax Error and a SCRIPT5007 Object expected error. I'm not sure where I am going wrong, and I really need to get this to work for IE11 unfortunately. None of my Vue components are self-closing in the blade files as answered in a similar question here. And I'm not using Vue CLI.
So I decided to remove all components and plugins, to see if Vue and Bootstrap-Vue worked on their own in IE11. It worked fine and I was receiving the usual Vue dev message in the console.
I then added in each module one by one until the website no longer rendered in IE11. This only happened when lottie-vuejs was enabled, and upon inspecting the console a syntax error is shown (expecting a '}''.
So the reason my project was not working was due to this plugin.
I'm running a React Native app off of Xcode 10.3 and am attempting to load some icon images within a detailView screen, but for whatever reason React Native cannot see them. Whether I reload or rebuild the project (react-native run-ios), I receive the following error message:
/Path/To/Project/src/components/DetailView.js: The module ../images/call#2x.png could not be found from /Path/To/Project/src/components/DetailView.js. Indeed, none of these files exist:
call#2x.png
/Path/To/Project/src/images/call#2x.png/index(.native||.ios.js|.native.js|.js|.ios.json|.native.json|.json|.ios.ts|.native.ts|.ts|.ios.tsx|.native.tsx|.tsx)
Here is my project's src directory:
And this image snippets from my detailView.js:
<ScrollView showsVerticalScrollIndicator={false}>
<Image
source={require('../images/background.jpg')}
style={[theme.cardImageStyle, styles.image]}
/>
</ScrollView>
// ... More code here
<View style={styles.actionArea}>
<TouchableOpacity>
<Image
source={require('../images/call#2x.png')}
style={styles.actionImage}
/>
</TouchableOpacity>
<TouchableOpacity>
<Image
source={require('../images/sms#2x.png')}
style={styles.actionImage}
/>
</TouchableOpacity>
<TouchableOpacity>
<Image
source={require('../images/email#2x.png')}
style={styles.actionImage}
/>
</TouchableOpacity>
</View>
Here is my dependencies list from package.json:
"dependencies": {
"lodash": "^4.17.15",
"react": "16.8.6",
"react-native": "0.60.4",
"react-native-gesture-handler": "^1.3.0",
"react-native-material-kit": "^0.5.1",
"react-native-vector-icons": "^6.6.0",
"react-navigation": "^3.11.1",
"react-redux": "^7.1.0",
"redux": "^4.0.4",
"redux-thunk": "^2.3.0"
},
"devDependencies": {
"#babel/core": "^7.5.5",
"#babel/runtime": "^7.5.5",
"#react-native-community/eslint-config": "^0.0.5",
"babel-jest": "^24.8.0",
"eslint": "^6.1.0",
"jest": "^24.8.0",
"metro-react-native-babel-preset": "^0.55.0",
"react-test-renderer": "16.8.6"
},
The strange thing is that it has no trouble finding the background.jpg file, but I receive the same error message whether or not I change the name of the file I am looking for in the require() statement. I assume this is a problem with how RN or Xcode is building the project (Xcode is killing me right now, moving slower than 90s dialup).
All help is much appreciated.
Remove #2x from image path or try to make other files for different screen densities like below:
call#1x.png
call#2x.png
call#3x.png
Then just use
source={require('../images/call.png')
DOCS
remove #2x suffix from image path, they're reserved to provide images for different screen densities, just
source={require('../images/call.png')
from RN Images docs
the packager will bundle and serve the image corresponding to device's screen density.
If there is no image matching the screen density, the closest best option will be selected
You don't need to specify image corresponding size to device by yourself