How do I edit the height of ion-title elements? - ionic-framework

I am attempting to add a text-shadow to an ion-title element, but the shadow is getting clipped. How do I avoid this, if possible? Unfortunately, there is no part accessible in the shadow DOM, and the .toolbar-title element within it is the one I need to resize. Any ideas of how to do this?
https://codepen.io/mattmc318/pen/zYBOVQP

Yes, sadly we don't have a part to access the title and you can't use .toolbar-title either to directly set the height, and many css properties won't work.
I tested in your codepen and seems that you can use line-height instead of height in your ion-title css selector to set the height of your line box:
ion-title {
font-family: 'M PLUS Rounded 1c', var(--ion-default-font);
font-weight: bold;
text-align: center;
line-height: 32px;
#include outline(4, rgba(137, 57, 233, 0.5));
}

Related

Magento 2 - Layered Navigation Swatches Styling

I am using Magento 2.4.5 and would like to make edit css of the icons in the layered navigation, need them smaller and put them in rows of 6.
I cannot find where I need to add/edit the css files for this part of the website. I tried Magento_Swatches\web\css\source_module.less but no result.
Any help would be appreciated.
Thank you
If you are using the default Luma theme:
Note: First, you need to check the template file of the CSS source used.
You need to edit the CSS file: swatches.css or custom CSS if you have created one. Getting the correct element may it can give you a correct catch.
Could you adjust the width and height of the swatch div? Please remember to specify! an important rule in CSS.
.swatches-globo .swatch--gl .ul-swatches-list li:not(ul.ul-globo-dropdown-option li), .globo-swatch-product-detail .swatch--gl ul.value li:not(ul.ul-globo-dropdown-option li) {
display: block;
float: left;
margin: 0 10px 10px 0!important;
}
Also,
.swatches-globol .swatch--gl li .globo-size-medium, .globo-swatch-product-detail .globo-detail-size-medium {
width: 35px;
height: 35px;
}
OR
.swatch-option.color {
min-width: 25px;
height: 25px;
}
Thanks

lineheight too big for textwrap/autoHeight

The data I want to display in ag-grid is predominantly blocks of text. I would like the text to wrap and the cell height to auto.
wrapText: true,
autoHeight: true
However, when the text wraps, it maintains a line-height of 40px, which is not attractive. I also notice it doesn't try to wrap on word.
I tried resetting the line-height, but then I lose any top or bottom padding. When I add the padding, the top padding is fine, but the bottom padding is hidden - the row height does not account for the padding.
How do I get an attractive block text display in a cell with decent padding of the cell contents?
You could add some CSS to directly target the cell content to add padding:
.ag-theme-alpine .ag-cell-value {
line-height: 20px !important;
word-break: normal; /* prevent words from breaking */
padding-top: 5px; /* space top */
padding-bottom: 5px; /* space bottom */
}
See this implemented in the following plunkr

Changing ticks height in ion-range

I'm trying to implement some functions that use ion-range as input. The functions are okay, my problem is related to the aesthetic issue of the ion-range element. Although there is this option to implement ticks in the documentation, they are the same height as the bar, making them very difficult to see if the primary color of the app is not dark enough.
I managed to modify it through the dev console and was able to acquire the style I wanted. I tried to modify the .range-tick class that is created, but to no avail. I saw a similar question that change the style of the range pin, but how can access this options for the range-tick?
I dev console I can see that style is currently this way:
.range-tick {
position: absolute;
top: calc((var(--height) - var(--bar-height)) / 2);
width: var(--bar-height);
height: var(--bar-height);
background: var(--bar-background-active);
z-index: 1;
pointer-events: none;
}
From this question suggestion I tried to add the currently empty variable --bar-height in my :root (src/theme/variables.scss), but this don't change anything.
I want to modify the class to include this options:
.range-tick {
position: absolute;
top: 25%; // <-- Changed
width: var(--bar-height);
height: 20px; // <-- Changed
background: var(--bar-background-active);
z-index: 1;
pointer-events: none;
}
I also tried to modify the range.md.css and range.ios.css files located in project_folder/node_modules/#ionic/core/dist/collection/components/range/, which looks exactly what I can see in dev console. After modify the class and recompile nothing has changed, in dev console Inspector I can see that the class is still using the initial class and not the modified one.
I read some comments of people in ionic forum saying that this can only be changed by Ionic team, so I created a new issue.
You can use CSS Shadow Parts.
To set the style for all non active ticks
ion-range::part(tick){
height: 10px;
width: 10px;
top: 16px;
border-radius: 50%;
}
To set the style of all active ticks
ion-range::part(tick-active){
height: 10px;
width: 10px;
top: 16px;
border-radius: 50%;
}
For more you can refer https://ionicframework.com/docs/api/range#css-shadow-parts

CSS3 Skew Again! : Unskew text without parent div so form focus state is proper

I have a simple problem, but I may be asking for the impossible.
I want to style my html form elements as parallelograms without skewing the contained text. I would normally do this by applying the transform to a parent div and applying the reverse transform to the content:
http://jsfiddle.net/ExUs9/3/
form {
background:#62CAD9;
padding:10px;
}
div {
background: white;
height: 30px;
margin: 10px;
width:300px;
transform:skewX(30deg);
-ms-transform:skewX(30deg);
-webkit-transform:skewX(30deg);
}
input {
background: none;
width: 100%;
height: 100%;
border: none;
transform:skewX(-30deg);
-ms-transform:skewX(-30deg);
-webkit-transform:skewX(-30deg);
}
My problem with the above is the focus property is still applied to the unskewed input box and displays as rectangular. The focus effect is only skewed if the input box itself is skewed:
http://jsfiddle.net/kdqKX/
form {
background:#62CAD9;
}
input {
margin: 20px;
background: white;
width:300px;
border: none;
height: 30px;
transform:skewX(30deg);
-ms-transform:skewX(30deg);
-webkit-transform:skewX(30deg);
}
The problem here is that the text is skewed.
I know I could just remove the focus outline, but is there any way to either:
Skew the input box--but not the contained text--without skewing via a parent div
Apply the border to the parent div when the child input box is focused
I don't know js or any scripts well, so a script free solution is preferred. I do, though, suspect this is impossible in pure css, so let me know any possible solutions.
Thank you, you brave internet geniuses,
Dalton
The easy solution would be a background image.
CSS gradient can fake this.
background-image:linear-gradient(45deg, #62cad9 0 , #62cad9 2em , transparent 2em ,transparent 230px, #62cad9 230px );
Try it without transform. http://jsfiddle.net/khGDj/
other easy way, would have been width pseudo-element and borders/blue/transparent. input do not take it as far as i know.

GWT Vertical Tabs like iGoogle

I am using GWT and would like to develop a vertical tab panel like the one in iGoogle.
How can the same be achieved ?
I had the same problem and decided not to use third party library just for one small widget. Here is a lightweight solution I ended up using - it is based on tweaking styles.
verticaltabpanel.css:
#external gwt-TabLayoutPanel;
.gwt-TabLayoutPanel>div {
position: static !important;
}
.gwt-TabLayoutPanel {
margin-left: 30px;
}
#external gwt-TabLayoutPanelTabs;
.gwt-TabLayoutPanelTabs {
top: 0 !important;
width: 140px !important;
}
#external gwt-TabLayoutPanelTab;
.gwt-TabLayoutPanelTab {
display: block !important;
margin-top: 2px;
padding: 8px 6px !important;
}
#external gwt-TabLayoutPanelContentContainer;
.gwt-TabLayoutPanelContentContainer {
left: 150px !important;
top: 0 !important;
}
Add it to resources as usually:
public interface YouAppResources extends ClientBundle {
#Source("verticaltabpanel.css")
CssResource verticalTabPanelStyles();
}
Then inject it when your app starts:
resources.verticalTabPanelStyles().ensureInjected();
Define the tab panel in your templates like this:
<ui:style>
.tabPanel {
height: 400px;
width: 800px;
}
</ui:style>
<g:TabLayoutPanel addStyleNames="{style.tabPanel}" barUnit='PX' barHeight='0'>
</g:TabLayoutPanel>
Note that you have to set height and width and the style should be added not set.
The drawback of this approach is that all the tab panels in your application will be now vertical. If you need to have a horizontal one, you can use old TabPanel (note that it is deprecated). It is fine for my case as I have a number of vertical tab panels in my application and only one horizontal.
you can use ext-js's vertical tabs - see this demo http://iamtotti.com/playground/js/ext-3.1.1/examples/tabs/tabs.html
there is a gwt port of ext-js which you can use : http://code.google.com/p/gwt-ext/
Smart gwt also has a vertical tab implementation (its different to gwt-ext's) - http://www.smartclient.com/smartgwt/showcase and search for orientation on the left menu.
thx for your answer, megas.
One extension to make it possible to use some TabLayoutPanels with horizontal (original) and some with vertical (new) layout:
one could add ids (i.e. #myVertTab) to the css selectors.
I think what you're looking for is the TabLayoutPanel (scroll down a bit). It works great and it's a vanilla GWT widget, no third party libraries required.