How to apply specific style to this input box - css

I am using the vue-tags-input (https://github.com/JohMun/vue-tags-input) - and now I'd like to apply the UIKit form styling to it (https://getuikit.com/docs/form).
I prepared this as an example here: https://codepen.io/spqrinc/pen/vQjRjB
This is the rendered tags-input:
<div data-v-7f2a58de="" class="vue-tags-input">
<div data-v-7f2a58de="" class="input">
<ul data-v-7f2a58de="" class="tags">
<li data-v-7f2a58de="" tabindex="1" class="tag valid">
<div data-v-7f2a58de="" class="content"><!---->
<div data-v-7f2a58de="" class="tag-center"><span data-v-7f2a58de="" class="">test</span> <!---->
</div> <!----></div>
<div data-v-7f2a58de="" class="actions"><i data-v-7f2a58de="" class="icon-undo"
style="display: none;"></i> <i data-v-7f2a58de=""
class="icon-close"></i> <!---->
</div>
</li>
<li data-v-7f2a58de="" tabindex="2" class="tag valid">
<div data-v-7f2a58de="" class="content"><!---->
<div data-v-7f2a58de="" class="tag-center"><span data-v-7f2a58de="" class="">test2</span> <!---->
</div> <!----></div>
<div data-v-7f2a58de="" class="actions"><i data-v-7f2a58de="" class="icon-undo"
style="display: none;"></i> <i data-v-7f2a58de=""
class="icon-close"></i> <!---->
</div>
</li>
<li data-v-7f2a58de="" class="new-tag-input-wrapper"><input data-v-7f2a58de="" type="text" size="1"
placeholder="Add Tag"
class="new-tag-input valid"></li>
</ul>
</div>
</div>
Now I'd like to overwrite the tag's form (the css class is not changeable) to behave just like the UIKit (Placeholder-size/font/color, Height, border, blue border on focus) just like you see in the codeine-example (input and textarea in this example). How can I do that?
I am using SASS to compile the static css - maybe I could #include the UIkit-source and use it to overwrite the vue-tags-input?
Unfortunately I don't know enough CSS and so I am very happy for an example.
Thanks in advance.

You would either #import the UIkit to your SASS stylesheet or you would make your own stylesheet that you make sure is loaded after it, either method works but by #import'ing the UIkit stylesheet you can e.g. alter variables so their code is compiled differently, but if you're not good at CSS or don't wanna learn how their project is structured so you import the right files in the right places then it would be easier to just go with you own stylesheet.
The below CSS would change the background color of the tags. If a value you change doesn't change you can try using !important tag on that value to force it to be used, just make sure your stylesheet is added AFTER the UIkit stylesheet and it'll work.
.vue-tags-input .tag {
background: #333 !important;
}
https://codepen.io/anon/pen/vQrLqm
You can place that in any CSS/SASS/LESS file and it'll change the color of the tags.
As a tip, if you right click on something in a website and press inspect it'll open the inspector where you can try adding new CSS to elements or classes and see the effects directly. I often use this to try out stuff before I recompile the CSS so I know the effects of my changes.

Related

How to make navbar-burger menu work on small screen like iPhone using angular and bulma?

When I click the burger menu on a small screen nothing happens. Of course, it works fine on a large screen. I have tried several "navbar" configurations. The included code at least compiles. I had a target defined : class="navbar-burger is active" data-target="navbar-menu" and an id for class="navbar-menu" id = "navbar-menu"
What am I missing?
<!-- logo -->
<div class="navbar-brand is-large">
<a class="navbar-item" href="#">
<img src="assets/img/Grayscale_cloud.png">
</a>
<div class="navbar-burger is active" data-target="navbar-menu">
<span></span>
<span></span>
<span></span>
</div>
</div>
<!-- menu -->
<div class="navbar-menu" id = "navbar-menu">
<div class="navbar-start">
<a class="navbar-item" routerLink="">Home</a>
<a class="navbar-item" routerLink="contact">Contact</a>
<a class="navbar-item" routerLink="networksupport">Network</a>
<a class="navbar-item" routerLink="managemnentreports">Management Reports</a>
</div>
</div>
</nav>
`,
I tried the code here to no avail. https://medium.com/#edigleyssonsilva/bulma-css-framework-with-angular-6-responsive-menu-and-navbar-burger-dff747ed2dc1
Several good examples here but I could not make them work with Bulma and Angular: I'm trying to use hamburger menu on bulma css, but it doesn't work. What is wrong?
Routing works as expected on a large browser. Burger menu appears on small screen but no appears when you press it.
there are a few things which might cause this for you - since you didn't paste a MCV example, i'll list them all
you didn't paste your toggle function for showing main-nav or burger nav... this is the toggle function (in app.component.ts) from the medium article link which you pasted
toggleNavbar() { this.navBurger.nativeElement.classList.toggle('is-active'); this.navMenu.nativeElement.classList.toggle('is-active'); }
to get this toggle function to work, you'd have to assign the names in app.component.html
you had <div class="navbar-menu" id = "navbar-menu"> ... which should have <div class="navbar-menu" id = "navbar-menu" #navMen>
and <a class="navbar-item" href="#"> .... </a> ...which should have
<a (click)="toggleNavbar()" role="button" #navBurger data-target="navbar-menu"> ... </a>
Also, we had to do npm install bulma
add the css in our angular.json:
"styles": ["node_modules/bulma/css/bulma.min.css" ],
you can check a working sample here

force bootstrap col-md vertical in desktop view with only css

i'm trying to force bootstrap to vertical align this col in desktop view. because it's overlaping otherwise
the mess now :
enter image description here
so the problem fix it self if i resize the windows until it reach the mobile view (it will automaticly vertical align the div.) but i want it to be like that in any windows size.
what i trying to :
enter image description here
here is the catch. i can only acsess the css on that particular div.
because it's dynamically generated. and i cant change the html part.
here is what the html looks like :
<ul class="subquestions-list questions-list checkbox-list list-unstyled">
<div class="row">
<div class="col-md-1">
<li id="javatbd736732X11537X92547SQ001" class="question-item answer-item checkbox-item">
<div class="checkbox">
<label for="answer736732X11537X92547SQ001" class="answertext"><input class="checkbox" type="checkbox" name="736732X11537X92547SQ001" id="answer736732X11537X92547SQ001" value="Y" onclick="cancelBubbleThis(event);checkconditions(this.value, this.name, this.type)"><input type="hidden" name="java736732X11537X92547SQ001" id="java736732X11537X92547SQ001" value="">Grundlagen der Informatik</label>
</div>
</li>
</div>
<div class="col-md-1">
<li id="javatbd736732X11537X92547SQ002" class="question-item answer-item checkbox-item">
<div class="checkbox"><label for="answer736732X11537X92547SQ002" class="answertext"><input class="checkbox" type="checkbox" name="736732X11537X92547SQ002" id="answer736732X11537X92547SQ002" value="Y" onclick="cancelBubbleThis(event);checkconditions(this.value, this.name, this.type)"><input type="hidden" name="java736732X11537X92547SQ002" id="java736732X11537X92547SQ002" value="">Theoretische Informatik</label></div>
</li>
</div>
</div>
</ul>
i can also acsess it with javascript using dom manipulation. but i dont think it helps that much.
please help me!
thanks!

Prevent background from scrolling when a modal is open (NOT BOOTSTRAP)

I have created my own modals from scratch and i want to prevent scrolling in the background when a modal is open, all i can find online is stuff about bootstrap which isn't helpful to me because my code doesn't automatically call 'modal-open' so
body.modal-open{
overflow:hidden;
}
Doesn't work for me.
<div id="wrapper3">
<a class="button" href="#openModal-4">
<img class="image"src="img/Animation.png">
<p class="text">Animation</p>
</a>
</div>
<div id="openModal-4" class="modalbg">
<div class="dialog">
X
<div class="popout">
<h1>2D Animation Project</h1>
<div>
<h2>Project Brief</h2>
<a class="modalfullimg"><img src="img/Design/moodboard.png"></a>
</div>
<h2>Sketches</h2>
<a class="modalfullimg"><img src="img/Design/initialsketches.png"></a>
</div>
</div>
</div>
Can you just modify the script you wrote to add a body class like 'modal-open' so you can apply the appropriate CSS? Seems like the easiest solution, if you're making it custom anyway.

Adding font awesome icon inline yet superscript with other element

I have two scenarios with similar problems. I'm attempting to add a font awesome icon:
Inline with a text input and 'add on' button, yet superscript (JSFiddle1)
<div>
<div class="input-group">
<input class="form-control">
<span class="input-group-btn">
<button class="btn btn-default" id="copy-link" type="button">
<i class="fa fa-files-o"></i> Copy
</button>
</span>
</div>
<span>
<i class="fa fa-info-circle"></i>
</span>
</div>
Inline with text in a bootstrap panel heading text, but in the top right corner of the heading area (JSFiddle2)
<div class="panel panel-default">
<div class="panel-heading">
<b>
Text
</b>
<span>
<div class="dropdown">
<i class="fa fa-cog dropdown-toggle listing-cog" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"></i>
</div>
</span>
</div>
<div class="panel-body">
</div>
</div>
Here's how I'd like each to look:
I don't know if this is important, but as a side note:
In the first scenario, the icon has a popover
In the second scenario, the icon has a dropdown
I don't think these have any effect on the layout, so I left out the related code.
For the first problem, your HTML structure is wrong. You need to add the icon inside the input-group DIV. Also to do superscript, you need a CSS class for that. Here is the update code for you:
JS Fiddle
For your second problem, your DIV must be displayed inline with a flotation. Here is the CSS for it:
.dropdown {
display:inline-block;
float:right
}
For your first issue: JS Fiddle
For your second issue as Raed N. said before just add a float:right to your dropdown:
.dropdown { float:right; }

How to achieve the following design in css in jquery mobile

![I want to achieve the following red circle through css. I am using jquery mobile with angular js.My code is as below.
<div data-role="page" id="p2">
<div class="ui-bar ui-bar-d "data-role="header" >
Chat
<h1> contacts </h1>
Photos
</div >
<div data-role="content" data-position="center">
<div ng-controller="TalkCtl">
<ul >
Search:
<input type="search" ng-model="searchText">
<li ng-repeat="talk in talks | filter:searchText">
{{talk.name}} </br> {{talk.text}}
</li>
</ul>
</div>
</div>
IMAGE SNAPSHOT
This can be easily done using css background-image property, coupled with positioning and z-indexing.

Resources