Default font size in VMWare Clarity v3 and Angular v9 - vmware-clarity

I'm a total noob to Angular and Clarity. I'm at the very beginning of my project but the font size is very small. I've gone through the Clarity documentation and I'm not sure what I'm missing. For instance, p, .p1 should be a font size of 14px according to the documentation. Yet it appears very small in the browser (Chrome) and when I check my source code using developer tools it shows the font size as .583333rem which translates to 8px. Font size is small in my header as well. Any help or push in the right direction would be much appreciated. Thanks!
app.component.html
<clr-main-container class="main-container">
<app-header></app-header>
<div class="content-container">
<div class="content-area">
<router-outlet></router-outlet>
</div>
</div>
<app-footer></app-footer>
</clr-main-container>
header.component.html
<clr-header class="header header-1" *ngIf="showHeader() == true">
<button type="button" class="header-hamburger-trigger" aria-label="Open"><span></span></button>
<div class="branding">
<a class="nav-link">
<img src="../../../assets/images/logo.png">
</a>
</div>
<div class="divider"></div>
<div class="header-nav clr-nav-level-1">
<a class="nav-link" href="#" aria-label="Test1"><span class="nav-text">Test1</span></a>
<a class="nav-link active" href="#" aria-label="Test2"><span class="nav-text">Test2</span></a>
</div>
<div class="header-actions">
<a href="#" class="nav-link nav-icon" aria-label="Ticket">
<clr-icon shape="help"></clr-icon>
</a>
<clr-dropdown>
<button class="nav-text dropdown-toggle" clrDropdownToggle aria-expanded="true" aria-label="open user profile">
<clr-icon shape="user" size="24"></clr-icon>
{{ first_name }} {{last_name }}
<clr-icon shape="caret down"></clr-icon>
</button>
<clr-dropdown-menu *clrIfOpen clrPosition="bottom-right">
<div clrDropdownItem>Change Password</div>
<div clrDropdownItem>Log Out</div>
</clr-dropdown-menu>
</clr-dropdown>
</div>
</clr-header>

Thank you both for your response! There wasn't anything conflicting with the CSS. I did a file search of the entire node_modules/clr directory and found several references to .583333rem in the clr-ui.min.css file. I went back to the Clarity documentation that says:
/*
* The following percentage would produce a UI that follows a design with a 32px vertical rhythm
* and 8px grid – 32 ÷ 0.192 = 166.66667.
*/
html{
font-size: 166.66667%;
}
I added this to my styles.css file and tada! I don't know if the Clarity documentation is wrong or misleading but I was under the impression from the typography section that the body text font is supposed to be 14px. Regardless, it's working and the larger font size no longer makes my eyes hurt. Thanks again!

This is related to the fact that Clarity uses an unusually large :root font-size of 24px. That's why it shows 14px on their website: 24px * 0.583333rem = 14px.
But if your :root font-size is smaller (as it should and probably is) it will show as way too small to read: 13.7 * 0.583333rem = 8px.
Solution: if you're OK with it, set your :root font-size, that you may find or declare on your global (s)css file, to 24px, like this:
:root { font-size: 24px }
P.S.: I can't understand why set the root font-size so big if you have to downsize everything afterwards.. this is a real question so, if someone knows the answer, please enlighten me.

Related

Bootstrap cols shorter than content

Lately, I've run into a problem when trying to get my web aps to work with small devices. Even then, this doesn't seem to always be an issue, it will depend upon the orientation of the phone. What I'm seeing is say I have a Bootstrap 4 ROW with a col-3 col-6 col-3 setup. The center col has more height and includes images where fade in and out of opacity, so the height is constant. When BS does its thing for smaller displays, the first col-3 breaks properly, leaving space for the col-6. The problem is the col-6 seems to break at the col-3 height and I get over lapping. When using the dev tools, I can see this is the case but I dont want to set a hard height because that makes the spacing go weird and defeats the whole BS purpose. Here are some examples:
<div class="row" style="margin: 0vh 5vw;">
<div class="col-md-3 col-sm-12 text-center wow fadeInLeft">
<div>
<i class="fa fa-eye features-icon"></i>
<h2 style="color: white; font-size: 3vmin">Something</h2>
</div>
</div>
<div class="col-md-6 col-sm-12 text-center wow" style="height: 53vh;">
<img id="img1" src="myImage.jpg" alt="dashboard" class="img-fluid img1" style="margin-top: 3vh;
display:block; position:absolute; opacity: 1;">
<img id="img2" src="~/anotherImage.png" alt="dashboard" class="img-fluid img2" style="margin-top:
3vh; display:block;position:absolute; opacity: 0;">
</div>
<div class="col-md-3 col-sm-12 text-center wow fadeInRight">
<div>
<i class="fa fa-database features-icon"></i>
<h2 style="color: white; font-size: 3vmin">More blah blah</h2>
</div>
</div>
</div>
This image shows where col is over lapping (blue icon)
BTW, I've set the center col height because without it, I get no height to that col. I've tried manipulating it, but it seems that whatever I do, it will fix it for one layout orientation and mess up the others. I must be missing something simple in BS. Thanks in advance for your help.
That row has an inline style defining a margin, maybe the view units are causing the problem. Try changing that around to % or px to see how it behaves or remove that margin all together and use bootstrap's margin utilities. Other thing I can think of would be to try and wrap the overlapping elements in two different .container-fluid
So, I ended up doing what I consider a cheat using jQuery. I gave the col div an id of #mcsCol and put this in my $(document).ready(function)
$("#mcsCol").css({ "height": $("#img1").css("height") });
So essentially, it will check the height of the image and set the col to the same height. If you have a more native solution, I'd love to see it.

font-size scaled in IE8?

In IE8
In IE7 and other browser
both page scaled in 100%.I found font-size in IE8 and only in IE8 was bigger than other browser.Is anyone can tell me the reasion and solution ?
here is the html and css:
<div class="a_ticket-box">
<a href="" class="a_ticket" id="a_ticket_en">
<img id="a_ticket_btag_en" src="../img/tag-en.png" alt="">
<h4 id="en-buy">PURCHASE TICKET</h4>
<p id="en-p">Newly added March 5-6 fifth floor ticket</p>
</a>
</div>
THX
I don't see your css code. As I see in html you don't have specified font size inside paragraph. Browsers can interpretate default font size in < p> different. You should set font size in css like:
#en-p {
font-size: 1em;
}
Or inline inside paragraph like:
<p id="en-p" style="font-size: 1em;">Newly added March 5-6 fifth floor ticket</p>

Center within a Bootstrap Well

I have been struggling to get the contents of a boostrap well to center. My badge goes to the right, instead of under the arrows, and my arrows (aka, vote buttons) are not centered in the well either. I have attached a screenshot, and here is the relevant code:
HTML:
<div class="col-md-1 col-sm-1 well">
<div class="votingButton" data-ng-controller="pfcArticleVoting" data-ng-click="upVote(article);">
<i class="glyphicon glyphicon-chevron-up"></i>
</div>
<div class="badge badge-inverse">
<div>{{article.articlevotes}}</div>
</div>
<div class="votingButton" data-ng-controller="pfcArticleVoting" data-ng-click="downVote(article);">
<i class="glyphicon glyphicon-chevron-down"></i>
</div>
Here is the only custom CSS beyond default bootstrap:
/* Voting styling */
.votingButton{
cursor: pointer;
}
Here is the screenshot:
try class="text-center", that should do the trick, if not you can reposition it using style="postion: absolute; margin-left: -5px;", if you're not too picky about the well size, that might be another problem as "well". fix the size to be a little bigger, that would help.
Your column width is too small to render correctly. You need to change col-md-1 col-sm-1 to col-md-2 col-sm-2 or reduce the padding inside the div.

bootstrap - button group - button being cut off on left hand side

Problem:
A button group I've created using bootstrap css appears cut off on the left, as you can see below.
Code:
I have the following HTML logic:
<div class="span5">
<div class="row show-grid">
<div class="btn-group>
<button class="btn dropdown-toggle hidden-desktop visible-phone btn-warning" data-toggle="dropdown">show info <span class="caret"></span></button>
<ul class="dropdown-menu">
<li><div id="address"><?php echo anchor("mycontroller/method1/".$objectid,'addresses'); ?></div></li>
<li><div id="logs"><?php echo anchor("mycontroller/method2/",'logs'); ?></div></li>
<li><div id="status"><?php echo anchor("mycontroller/method3/",'status'); ?></div></li>
</ul>
</div>
<br/>
<div class="span2"><?php echo anchor("mycontroller/method4/","Back to List")?></div>
</div><!-- end class row show-grid-->
<br/>
</div>
What I've Tried So Far:
I've been using Firefox's Inspect tool to try to find the differences between the top button and the bottom, but I don't know what property I should be looking for. I've tried modifying properties like:
padding-left
padding-right
margin-left
margin-right
I've also tried to reduce the number of classes applied to the button so that I only had:
<button class="btn btn-warning dropdown-toggle" data-toggle="dropdown">
But that didn't resolve the problem. Can someone point me in the right direction? Perhaps by naming the types of properties I should be tracking down? It's probably a CSS specificity problem... because I haven't modified any of the bootstrap stuff.
Thanks
Why are you using a button group for buttons that aren't grouped together? The reason it's "cut off" is because button groups are supposed to be merged together.
Regardless, it's displayed like that because the inner borders of the buttons don't have rounded edges. You can fix it by manually applying the border radius:
border-top-left-radius: 4px; border-bottom-left-radius: 4px
Give this CSS
.btn{
display:block;
padding:XXpx;
margin:XXpx;
height:XXpx;
width:XXpx;
}
this is a hack fix but on the containing div that is wrapped around the button - you may simply have
overflow:hidden
Inspect in chrome with firebug and go up and you will most likely see this.. Bootstrap hides data that overflows the columns.
OMG,
the answer is:
to change from:
<div class="btn-group>
to:
<div class="btn-group">
You forgot the "
You can see the live fix here: http://jsfiddle.net/kCsEs/
Following solved my problem
.btn {
width:auto !important;
}

Why is this css selector not working? [closed]

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.
Closed 9 years ago.
I have the following code (generated by Drupal; I have no control over it.)
<div class="spacer">
<div class="region region-home-ad-banner">
<div id="block-views-banner-ad-block-block" class="block block-views contextual-links-region">
<div class="contextual-links-wrapper">
<ul class="contextual-links">
<li class="views-ui-edit first">
Edit view
</li>
<li class="block-configure last">
Configure block
</li>
</ul>
</div> <!-- end contextual-links-wrapper -->
<div class="content">
<div class="view view-banner-ad-block view-id-banner_ad_block view-display-id-block view-dom-id-542147d83a500d1c31244e2e2a583562">
<div class="view-content">
<div class="views-row views-row-1 views-row-odd views-row-first views-row-last">
<div class="views-field views-field-field-ad-image">
<div class="field-content">
<a href="http://www.externallink.com" target="_blank">
<img src="expo-home-page-banner.jpg" width="912" height="100" alt="" />
</a>
</div>
</div>
</div>
</div>
</div>
</div> <!-- end content -->
</div> <!-- end block-views-banner-ad-block-block -->
</div> <!-- end region-home-ad-banner -->
</div> <!-- end spacer -->
I have this css that works:
.spacer img{
background: #ffffff;
border:5px;
margin-left: 0px;
padding-top: 30px;
padding-bottom: 20px;
}
I need to apply a background style to the div with the class "region-home-ad-banner", so I tried this:
.spacer>div.region-home-ad-banner {
background: #ffffff;
}
According to Firebug, that selector isn't being applied at all. It's not being overwritten by something with higher priority, it just isn't happening at all.
Why would .spacer img find what it needs to, even though the img tag is buried in multiple levels, but .spacer>div.region-home-ad-banner isn't finding the div that's the immediate child of .spacer?
EDITED TO ADD SCREENSHOT
This can be due to several reasons:
Caching:
Open the CSS tab in firebug, choose the CSS file, and make sure that rule is available in your CSS.
In that case, clear your cache (sometimes CTRL + F5 are not enough) and retry.
Typo:
Make sure you don't have any typo errors, open the console in firebug and check for warnings. Or open the Error Console in Firefox. (Tools--> Web Developer --> Error Console)
It can be a typo from a previous rule, for example, forgetting to put a closing curly bracket (}) will break your following rules.
From the structure of the HTML generated by drupal and the fairly unique class you are trying to use it looks like you don't need the direct descendant selector ">" and could try not using it:
.spacer div.region-home-ad-banner {
background: #ffffff;
}
However I see no reason why that selector should not work.

Resources