I am trying to change color of text using style css in v-textarea but it only change outline
<v-textarea style="color:blue"></v-textarea>
Try this:
<style>
.my-textarea textarea { color: blue !important }
</style>
<v-textarea class="my-textarea"></v-textarea>
The answer of F.NiX will be correct if you want your style to be applied globally.
If you work in a component and must stay in a scoped style. You must provide deep selector because this is a dynamic generated content.
<v-textarea
class="my-textarea">
</v-textarea>
<style scoped>
.code-style /deep/ textarea{
color:red !important;
}
</style>
Related
The title pretty much says it, I have searched the documentation and all I can find is this:
https://docs.telerik.com/aspnet-core/tag-helpers/editors/numerictextbox/overview
Which does not address it at all.
Here is my current line of code:
<kendo-numerictextbox name="currency" id="txtCheckNumber" format="#" min="0" enable="true" max="9999999999" spinners="false" value="10001" > </kendo-numerictextbox>
I have tried the obvious width="100px" and width="100" with no success
The only way I could figure out how to set the width was to override the Kendo styles on the wrapper spans and the input.
<style type="text/css">
.k-widget.k-numerictextbox {
width: 100px !important;
}
.k-numeric-wrap.k-state-default {
width: 100px !important;
}
.k-numeric-wrap input {
width: 100px !important;
}
</style>
This question already has an answer here:
Vuetify - CSS not working (taking effect) inside component
(1 answer)
Closed 4 years ago.
I am trying to modify the css of the vuetify components for example change the font-size to 10px, but it does not take my class into account
Is there a solution for this ?
I'm gonna assume you are using one of the pre-processors out there (SASS or Stylus).
So the thing is that you probably have the style section scoped for example <style lang="scss" scoped>.
What you want to do, is to use the deep selector so the styles from your parent component will leak into the child component, in this case vuetify component.
That can be achieved in sass like so:
<template>
<div class="button-wrapper">
<v-btn color="success">Success</v-btn>
</div>
<template>
And then in the style tag:
<style lang="scss" scoped>
.button-wrapper /deep/ button{
background: #00e389;
color: #fff;
}
</style>
Note: I do not use Stylus but if I'm not mistaken the syntax for deep is >>> so in this case, it will be .button-wrapper >>> button. you can read more about it here in the vue-loader docs
You could add this to your component:
<!-- in your component -->
<template>
<p class="change-font">Changing font</p>
</template>
<script>
export default {
};
</script>
<style lang="css" scoped>
.change-font{
font-size: 10px;
}
</style>
If you are using stylus, scss, or something else, change lang="css" to lang="stylus" or lang="scss"
Hope this helps.
If you are using stylus, you can do it :
<style lang="stylus" scoped>
.wrapper >>> button
font-size 10px
</style>
Is there a recommended way to let Icon Fonts (eq. FontAwesome/Octicons) bleed into the Shadow DOM?
At the moment, when I want to use an icon in a custom element's Shadow DOM I have to include parts of the ociticons.css file inline in the Shadow DOM:
#shadowroot
<style>
.octicon, .mega-octicon {
font: normal normal normal 16px/1 octicons;
display: inline-block;
text-decoration: none;
text-rendering: auto;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.mega-octicon { font-size: 32px; }
.octicon-search:before { content: '\f02e'} /* */
</style>
<button>
<span class="mega-octicon octicon-search"></span>
</button>
(Apparently, #font-face does bleed into the Shadow DOM.)
No, there is no “recommended way” to use icon fonts just because those are simply a bundle of css and shadow DOM is intended to hide light css. So your request contradicts the purpose of shadowing.
The common approach is to build the component for showing font-related icons. Every custom component library has in fact it’s own component to show font-icons. Just google for font-awesome polymer or like. A random example.
Sidenote: #font-face does not bleed into shadow. It’s the directive setting the relation between fontname and the file where this font to take from, for those fonts which are not known to browser yet. That said, whether you’d try to declare:
#font-face {
font-family: my-octicons;
src: url('octicons.otf');
}
and then use it like:
font: normal normal normal 16px/1 my-octicons;
in shadow, it won’t be resolved. The reason it’s resolved in your case is that the browser knows where to take the font to show. In general, it’s the same case as if you were declaring:
font: Helvetica;
without any #font-face in before.
Hope this helps.
The following element works fine in Chrome, but not in firefox.
What I'm expecting to see is my theme colours, which is defined in a separate place.
Now in firefox, the component itself renders, and it even creates the .swatch div, with the correct size of 40x40, as specified in the shadow dom styles. Unfortunately the background-color and border css rules are never applied.
The console output in firefox and chrome is exactly as I would expect, with the correct colours, which tells me that the values does exist, but for some reason the data is not bound to the template in firefox?
<polymer-element name="color-sample" attributes="color border">
<template>
<style>
.swatch {
width: 40px;
height: 40px;
margin-right: 0.5em;
background-color: {{ swatchColor }};
border: 1px solid {{ borderColor }};
}
</style>
<div id="sample" layout horizontal center>
<div class="swatch"></div>
<content></content>
</div>
</template>
<script>
Polymer({
color: "white",
border: "lightGrey",
ready: function() {
this.swatchColor = CoreStyle.g.theme[this.color];
this.borderColor = CoreStyle.g.theme[this.border];
console.log(this.swatchColor);
console.log(this.borderColor);
}
});
</script>
</polymer-element>
I should also point out that if I use inline styles directly on the .swatch div, then the binding seems to work fine, but I'm specifically looking for a solution to bind to the css directly to keep the html clean.
Seems I found the problem right after I posted.
Data binding isn't fully supported in <style> under the shadow dom.[1]
[1] https://github.com/Polymer/polymer/issues/456
After creating a listview from VS2010 and adding it as a web part to sharepoint 2010, the rows have an alternating color which i do not want but cannot seem to change. I have tried putting in conditional formatting for columns and rows as well but it does not work!
I have tried changing the style in the .ascx file as well to :
<style type="text/css">
.style1
{
width: 159px;
height: 53px;
background-color: White;
text-align:left;
}
</style>
<img alt="" class="style1"
<SharePoint:ListViewByQuery runat="server" ID="ProjectsListView" class ="style1" />
but nothing seems to work! Does anyone have a solution for this? thank you!
Try:
<style type="text/css">
.ms-alternating
{
background-color: White;
}
</style>