I would like to remove all rounded corners in my application using the Ant Design framework.
I tried adding different permutations of ant* in my index.css but i cannot get it to work.
index.css
body {
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen",
"Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue",
sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
code {
font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New",
monospace;
}
.ant {
border-radius: 0px;
}
Ant Design allows you to customize our design tokens in order to meet the needs of UI diversity from business and brand, including primary color, border radius, border color, etc..
Here is documentation
#border-radius-base: 0px; // major border radius
Or override above
#import '~antd/dist/antd.less'; // Import Ant Design styles by less entry
#import 'your-theme-file.less'; // variables to override above
Related
I would like to override the global Antd font. I've found a few examples but the Antd styling is always taking precedence.
In the top level component (App.tsx) I'm importing an scss file. This file is being loaded correctly as I can see the style being overridden when inspecting the page.
app.scss
#font-face {
font-family: 'Mulish', serif !important;
}
&:root{
font-family: "Mulish", serif !important;
}
html body{
font-family: "Mulish", serif !important;
}
body{
font-family: "Mulish", serif !important;
}
The font-family is instead set to the Antd default. If I turn disable this css when inspecting it falls back to the Mulish font.
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
How can the global font be overridden with Antd 4.23.0?
I am using Vuestic Admin as a template (based on Vuetify) and my (similar to ) component is strangely displaying different fonts for the selected option (inside the input field) and the dropdown options to be selected.
Is there a way to set all of them to the same font?
(I tried setting the "font-family" in the style field, but it hasn't worked).
My with different fonts: https://i.stack.imgur.com/pqEKj.png
I had this same issue and made the following change that resolved it:
In App.vue, move the font-family: "Source Sans Pro", Avenir, Helvetica, Arial, sans-serif; declaration from the #app scope into the body selector...
<template>
<router-view />
</template>
<style lang="scss">
#import "~#/sass/main.scss";
#app {
/* FROM HERE ✂️ */
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
color: #2c3e50;
}
body {
/* TO HERE 👇 */
font-family: "Source Sans Pro", Avenir, Helvetica, Arial, sans-serif;
margin: 0;
background: var(--va-background);
}
</style>
The font changes in mac and iOS platforms. How to ensure the same font appears. My index.css file :
body {
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
code {
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
monospace;
}
The first font you specified is preferred and since it is an alias it might be different among different Apple devices. If you want it to resolve to the same font everywhere, specify one, for example "Roboto". It is recommendable to use Googles WebFontLoader to download Robot in order to avoid ugly reflows when the font is not instantly available.
You can get the fonts from local repository and use font-face to insure that your fonts now are read from the same repository not from the device.
Download the fonts you intend to use and put them in public/Fonts directory, then in your root css add those fonts
e.g:
#font-face {
font-family: 'Segoe UI';
font-style: normal;
font-weight: normal;
src: local('Segoe UI'), url('SEGOE-UI.woff') format('woff');
}
{.....}
or/and whatever other fonts you're using
I just updated my Chrome browser and for some strange reason, the headings of my website look thinner. I did some research and the problem occurs when the font-weight is larger than 1.2em. 1.2em and smaller work fine.
System:
MacBook Pro Version 10.15.2 Catalina
Google Chrome Version 81.0.4044.113 (Official Build) (64-bit)
My CSS:
body, button, input, select, textarea {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
font-weight: 400;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
h1, .h1, h2, .h2, h3, .h3, h4, .h4, h5, .h5, h6, .h6 {
font-size: 1em;
font-weight: 600;
}
h1, .h1 {
font-size: 1.65em;
}
Research:
The problem has nothing to do with font smoothing (I double checked),
but I think it might has something to do with the font, Because when
I remove -apple-system, BlinkMacSystemFont the problem disappears.
It is not only related to headings, but it also occurs on other elements like buttons with a bigger font size than 1.2em.
Font-size: 1.3em:
Font-size: 1.2em:
It seems to be a Chrome problem and will probably be resolved in next Chrome updates https://www.bram.us/2020/04/09/chrome-vs-blinkmacsystemfont-when-bold-is-not-bold/
I am generating components with ReactJS that get rendered as a webpage - great all working so far. However, If I render elements outside of the screen I am unable to scroll to them.
The only way I can see the elements outside of the screen is if I zoom out. why is this? Does anyone know How to change this?
Everything I search in google is either about a scroll event or a none ReactJS environment.
I have many css files, but the index.css (which is automatically generated my create-react-app) looks like this:
body {
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen",
"Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue",
sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
code {
font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New",
monospace;
}