css animation not work. is there a problem with my code - css

its is very simple problem
so i just copied css from https://github.com/jh3y/whirl/blob/dist/css/building-blocks.css that give loading animation in css and i want it to apply it to my react project
I'm sure I included correctly, but it still doesn't work. and i am just doing like this
<div className="building-blocks" />
but its not working. is there any problem with the css code or can you show me how to do it correctly

its not the classname, it should be animation name, you can name your div class whatever you want!
.building-blocks {
animation: building-blocks;
}

Related

Styling Issues with React-Scroll Link component in Navbar

I am having an issue with the Link component from the react-scroll library. I am trying to achieve a simple hover effect on my navigation links, where they increase in size using transform: scale(1.1). However, this effect is not working. I've tried using normal div elements instead of Link tags and the effect works fine, so I suspect there is something in the react-scroll library that is conflicting.
Here is my code:
JSX:
import React from "react";
import { Link, Element, Events, animateScroll as scroll, scrollSpy, scroller } from "react-scroll";
import "../App.css";
function Navbar() {
return (
<Link
activeClass="active"
to="about"
spy={true}
smooth={true}
offset={-100}
duration={500}
className="navbar-item"
>
Hover over me to make me grow, click me to scroll down
</Link>
);
}
export default Navbar;
CSS:
.navbar-item {
transition: all 0.3s ease;
}
.navbar-item:hover {
transform: scale(1.1);
}
I would appreciate any assistance in resolving this issue. Thank you in advance!
I have checked your code, and even though everything seems to be correct, it wasn't scaling or any other thing related to transforming property on hover. I think this might also be the case with a simple tag. So the solution that I came up with is to put your tag inside another tag and give your "navbar-item" class to that div instead. This way it will work, and you can do whatever you want on hover.
For the record here is where I tried your react component: https://playcode.io/1188754
And here is the live preview for it:
https://1188754.playcode.io/
Let me know if this was helpful or if you found any other solution.

Cannot make background image from within the file to display on dive in TailwindCSS

I am trying to display a specific background image on a div in style or class by using Tailwind CSS but the image in not appearing. I cannot put it as a image since i want it to repeat throughout the div.
`
<div style="background-image: url('/wave.svg');" class="block bg-repeat-x bg-contain bg-center" >
**code**
</div>
`
I have tried to put the url as "../public.wave.svg" but the terminal outputs:
files in the public directory are served at the root path.
Instead of /public/wave.svg, use /wave.svg.
I have also tried it within a class in the div but cannot seem to find the problem to why my image is not showing up. When i put it as a img src it appears but i cannot manipulate it like that.
if you want to find here that simple real problem...
first go tailwind 'output.css' and add here a standart css class like '.addtest{}' with include your background.svg !
add it to your div, and is it works ?
is it don't work ? (find your real problem..)
ok, is it solved for standart css ?
now go and and take that css to your inner tailwind css or direct inline-css to html with 'style'.
are you try "./folder/image.svg"
not "../folder/image.svg"
not "/folder/image.svg"

How do I use CSS as a prop for a Vuetify v-tab?

I am trying to change my website to make color palette swapping easier, as we are still trying to find colors that work still. We are using Vue and Vuetify with SCSS generating our main CSS file. We are using almost exclusively Vue SFCs. I am currently stumped by a V-Tab issue where the "active" bar underneath won't change color.
The main issue is that, when using Vuetify components, in-file CSS has little impact. When I pass color="#ffffff" as a prop, it works wonderfully, everything is great. However, I cannot use CSS to change the colors in the same way at all (the produced code actually has the bar in a different div outside of the tab element).
I have tried overwriting the v-tabs-slider-wrapper element style every which way I could think of, to no avail
I have tried using SCSS functions inside the computed section of the SFC
I have tried basic CSS and SCSS
I have tried v-binding the color attribute to a computed function that referenced the SCSS function
I have tried using classes, ids, names, etc.
I tried background-color in all iterations as well, as a hope
If any one can help me, I'd appreciate it.
<template>
<v-tabs class="tabs">
<v-tab>Thing</v-tab>
<v-tab-item>Inner Thing</v-tab-item>
</v-tabs>
</template>
<script>
export default { };
</script>
<style lang="scss" scoped>
#import "../styles/main.scss";
.tabs div {// this was the only way to get the tab **text** to change, doesn't work for the slider bar
color: getColor_fromText("color"); //defined in main.scss
}
</style>
Did you try the color property of the slider?
<v-tabs-slider color="yellow"></v-tabs-slider>
Example here:
https://vuetifyjs.com/en/components/tabs/#custom-icons
If you want to change the background color of a specific tab you could try something like this:
<v-tabs
:background-color="activeTab === highlightTab ? 'deep-purple accent-4' : ''"
v-model="activeTab"
>
See full example (click on the second tab):
https://codepen.io/DomHaas/pen/qBZrZVy

Angular UI bootstrap progressbar minimum width

I am trying to set the minimum width of the angular UI bootstrap progressbar. I checked the docs and they do not mention how to do this. I know for the 'regular' bootstrap you can use something like style="min-width: 10em;". However this only works if you wrap it in the standard progress bootstrap divs like so:
<div class="progress">
<uib-progressbar class="progress-striped active progress-bar" value="value" style="min-width: 10em;">
<span> text </span></uib-progressbar>
</div>
But this displays a progressbar bar without the 'active' animation since regular bootstrap does not support this. When I try it like so it does not set the min-width property
<uib-progressbar class="progress-striped active progress-bar"value="value" style="min-width: 10em;">
<span> text </span>
</uib-progressbar>
edit: I overlooked the animation section in the 'regular' bootstrap docs. I would however like to use the UI bootstrap progressbar if possible.
Regular Bootstrap supports animated progress bars.
Are you sure that you correctly imported Boostrap files? I think you might have included only the CSS file but not the JS. Take a look at the basic template to see which files you should include.
Take also a look at the uib-progressbar documentation. The code snippet you wrote seems to be correct. As I said, I think the reason for this problem is that you didn't include the JS file for Bootstrap.
EDIT: Oh, ui-bootstrap apparently doesn't need Bootstrap's JS, you're right.
Regarding the min-width part of your question: I noticed that you added the progress-bar class to the <uib-progressbar> element. According to the documentation, the progress-bar class should not be used (it will be added by ui-bootstrap to the <div> element that will be rendered inside <uib-progressbar>, and you can easily verify this by inspecting the progress bar width devtools).
Thus, the min-width property is to be applied to the internal <div>. However, since the rendering is managed by angular, the only way to change it is to add a CSS rule like this:
.setminwidth .progress-bar {
min-width: 20em;
}
And then add the new setminwidth class to the external <uib-element> like this:
<uib-progressbar class="progress-striped setminwidth" value="22" type="warning">22%</uib-progressbar>
I tested this but it doesn't seem to work. I think it's because min-width: 0; is hardcoded in the template, and it gets reset everytime ui-bootstrap re-renders the element.
I tried adding !important to the CSS rule, to avoid being overridden, but it doesn't work either.
I guess at this point you should consider why you need to add this min-width property, since ui-bootstrap likes to override it. Could it be because you don't want the progress bar to be "too empty" when the % is low? If that's the case, I think you should look up the changes recently introduced by Bootstrap: it seems that now they add a special min-width for 0%, 1% and 2%.
UPD: The Bootstrap folks apparently changed their mind and reverted the special min-width value. At this point, I think that ui-bootstrap should follow along and remove the hardcoded min-width: 0; as it's not needed anymore. I just sent a pull-request to them. If they merge it, you will be able to use the CSS I posted above.

Add a .CSS style element to a link button in JQuery Mobile

I want to add a Style to a link button element in JQuery. Following is my code which is not working. How can I achieve this? Any suggestions?
Here is the HTML
<div data-role="content">
EXIT
</div>
Here is the CSS.
.linkBUTTONS{
color: #1dace3;
}
Any help is much appreciated, as I am pretty new to HTML/CSS and JQuery Mobile.
UPDATE
When I put it like this, style as an attribute of the given link, it works.
EXIT
But when I put it in a separate StyleSheet it doesn't work.
Check for the precedence. There maybe other rules that override your style. You can check all this in developers mode. Also you can try writing rules with !important. Did you try changing class name to link-buttons or something other? Example
.link-buttons {
color: red!important;
}

Resources