Atom text editor not setting background image - css

I'm trying to set background for my atom text editor from the post
https://discuss.atom.io/t/setting-background-images/9002
I tried the same code and I'm not sure why the editor is not rendering any background image. Can someone please help?
I'm attaching the stylesheet. Styles for setting background is in the last 7 lines of the snippet.
/*
* Code by William Chang and Matt McFarland
* https://medium.com/#docodemore/an-alternative-to-operator-mono-font-6e5d040e1c7e#.ofkdp0aww
* flottflott - http://www.dafont.com/flottflott.font
* Fira Code - https://github.com/tonsky/FiraCode
*/
atom-text-editor {
font-family: 'Fira Code';
font-style: normal;
text-rendering: optimizeLegibility;
}
atom-text-editor.editor {
background: rgba(0,0,0,0);
.syntax--string.syntax--quoted,
.syntax--string.syntax--regexp {
-webkit-font-feature-settings: "liga" off, "calt" off;
}
.syntax--source.syntax--js.syntax--jsx > .syntax--keyword.syntax--control.syntax--flow.syntax--js,
.syntax--storage,
.syntax--type .syntax--function {
vertical-align: baseline;
font-family: 'flottflott';
height: inherit;
font-size: 1.5em;
line-height: 1rem;
}
.syntax--storage.syntax--type.syntax--function.syntax--arrow.syntax--js {
font-size: 1.5em;
line-height: 1rem;
}
.syntax--comment {
font-style: italic;
}
.syntax--source.syntax--js.syntax--jsx > .syntax--keyword.syntax--control.syntax--flow.syntax--js {
font-family: 'Fira Code';
font-style: normal;
}
.syntax--string.syntax--unquoted.syntax--js {
color: #CDD3DE;
}
.syntax--entity.syntax--name {
font-weight: bold;
}
}
.pane {
background: url('http://gzhaixier.com/data/out/62/46169594-dark-background-images.jpg');
background-size: cover;
}
.editor {
background: rgba(0,0,0,0);
}
Thank you!

Related

Default CSS styling to use with new projects

I have a set of default styles I use with new projects and want to know whether there are any issues or imperfections with them. Can anyone see anything that could be detrimental or bad in any way?
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
html {
font-size: 62.5% /* makes 1rem 10px */
}
body {
font-size: 1.6em; /* default font of 16px */
font-family: 'Verdana', 'Arial', sans-serif;
line-height: 1.3;
color: #373737;
}
/* fonts */
h1 { font-size: 3rem }
h2 { font-size: 2.4rem }
h3 { font-size: 2rem }
h4, li, label, input, textarea, select, p {
font-size: 1.8rem;
}
h5 { font-size: 1.6rem }
h6 { font-size: 1.4rem }
ol, ul { padding-left: 2em }
a {
text-decoration: underline;
color: blue;
}
a:hover { color: pink }
a:focus { color: orange }
a:active { color: red }
a:visited { color: purple }
I'd be curious to know your thoughts or any feedback. Thank you.
It looks preety good to me, although I don't like using h5 and h6 tags to smaller texts. Tags "h" are heads and should always work as highlighted information.

Less mixins do not inherit classes

I'm new with Less.js, I need to reuse the p.InputTitle like my examples, but it is not working for me :( it is giving me an error. I read more about mixins and some people tell me that I can use 'Extend'. What is that?
Here My code :
.LoginForm {
p.InputTitle {
color: #656565;
font-size: 14px;
font-family: #OpenSans;
font-weight: 600;
}
}
.Membership{
p.InputTitle {
.LoginForm p.InputTitle;
}
}
Use Less extend pseudo class:
.Membership{
p.InputTitle {
&:extend(.LoginForm p.InputTitle);
}
}
This will then produce:
.LoginForm p.InputTitle,
.Membership p.InputTitle {
color: #656565;
font-size: 14px;
font-weight: 600;
}
Your syntax is calling in the form of a mixin call and a mixin name cannot be p.InputTitle.
If you were to change your original LoginForm CSS to the following then this would act as a valid mixin:
.LoginForm {
.InputTitle {
color: #656565;
font-size: 14px;
font-weight: 600;
}
}
You could then write:
.Membership{
p.InputTitle {
.LoginForm .InputTitle;
}
}
However this would then produce double the amount of CSS styles:
.LoginForm .InputTitle {
color: #656565;
font-size: 14px;
font-weight: 600;
}
.Membership p.InputTitle {
color: #656565;
font-size: 14px;
font-weight: 600;
}

if font-size is 100%, how can I make the headers bigger?

I have defined my Font-size as 98% in the body, just as follows:
body {
color: #6B6B6B;
background-color: #262626;
font-family: arial, sans-serif;
font-size: 98%;
line-height: 1.32;
text-align: center;
-webkit-text-size-adjust: none;
-webkit-font-smoothing: antialiased;
-webkit-overflow-scrolling: touch;
}
The problem now, how can I make my h1 a bit bigger? and h2 big as well?
I tried:
h1 {
font-size: 120%;
line-height: 1;
}
But I don't think this is right, do I need to use px or em for my headers?
Using % is valid CSS.
You can have
h1{
font-size:150%;
}
You can use em what is able to scale your font. For example:
h1 {
font-size: 1.2em;
line-height: 1;
}
is equal to 120% of current font size.
Here you have useful article about font sizing.
Base on #verbose-mode comment, you can avoid the h1 and h2 elements to be selected by using the :not selector:
body {
color: #6B6B6B;
background-color: #262626;
font-family: arial, sans-serif;
line-height: 1.32;
text-align: center;
-webkit-text-size-adjust: none;
-webkit-font-smoothing: antialiased;
-webkit-overflow-scrolling: touch;
}
body *:not(h1):not(h2){
font-size: 30%;
}
You can see this fiddle.

Css Icon Does Not Work After Host Upload

I use a template for my web project and in asp.net. In localhost my icons seen clearly like top of picture but when i upload it to host it seen like below the correct one. When i look css codes of template i saw like this:
#font-face {
font-family: 'FontAwesome';
src: url('../font/fontawesome-webfont.eot?v=3.1.0');
src: url('../font/fontawesome-webfont.eot?#iefix&v=3.1.0') format('embedded-opentype'),url('../font/fontawesome-webfont.woff?v=3.1.0') format('woff'),url('../font/fontawesome-webfont.ttf?v=3.1.0') format('truetype'),url('../font/fontawesome-webfont.svg#fontawesomeregular?v=3.1.0') format('svg');
font-weight: normal;
font-style: normal;
}
[class^="icon-"], [class*=" icon-"] {
font-family: FontAwesome;
font-weight: normal;
font-style: normal;
text-decoration: inherit;
-webkit-font-smoothing: antialiased;
*margin-right: .3em;
}
[class^="icon-"]:before, [class*=" icon-"]:before {
text-decoration: inherit;
display: inline-block;
speak: none;
}
.icon-large:before {
vertical-align: -10%;
font-size: 1.3333333333333333em;
}
a [class^="icon-"], a [class*=" icon-"], a [class^="icon-"]:before, a [class*=" icon-"]:before {
display: inline;
}
[class^="icon-"].icon-fixed-width, [class*=" icon-"].icon-fixed-width {
display: inline-block;
width: 1.2857142857142858em;
text-align: center;
}
[class^="icon-"].icon-fixed-width.icon-large, [class*=" icon-"].icon-fixed-width.icon-large {
width: 1.5714285714285714em;
}
ul.icons-ul {
list-style-type: none;
text-indent: -0.7142857142857143em;
margin-left: 2.142857142857143em;
}
ul.icons-ul > li .icon-li {
width: .7142857142857143em;
display: inline-block;
text-align: center;
}
[class^="icon-"].hide, [class*=" icon-"].hide {
display: none;
}
.icon-muted {
color: #eee;
}
.icon-glass:before {
content: "\f000";
}
I am not good at css. What is that and how can i solve this?
Make sure you also upload the font to the webhost, and link it correctly according to this line: ../font/fontawesome-webfont.eot?v=3.1.0

responsive fonts, margins, paddings

I have this basic css style.
What am i trying to do is to make the text responsive(fonts), i know i have to use ems / rems to do that ( i choose rems with a fallback to px not sure if it's right but you can see in the code how i did, the px i'm not sure if i set it right), the formula i used was font size divided by 16px.
Now we have a relative font size for h tags i think.. but still if i would like to resize the browser doesn't do any magic. Can you help me understand how to make the fonts responsive using rems or something else, using rems/other on setting margins, paddings, line-height? a complex example and explanation is welcomed :-d thank you very much for your time.
html {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
-webkit-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
}
body {
background-color: #fff;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-weight: 400;
color: #000000;
position: relative;
-webkit-font-smoothing: subpixel-antialiased;
-webkit-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
width: 100%;
min-width: 0;
}
html,
body {
height: 100%;
}
h1,
h2,
h3,
h4,
h5,
h6 {
font-weight: bold;
margin: 0 0;
margin: 0 0;
}
h1 {
font-size: 3px;
font-size: 3rem;
}
h2 {
font-size: 2.25px;
font-size: 2.25rem;
}
h3 {
font-size: 1.5px;
font-size: 1.5rem;
}
h4 {
font-size: 1.125px;
font-size: 1.125rem;
}
h5 {
font-size: 1px;
font-size: 1rem;
}
h6 {
font-size: 0.875px;
font-size: 0.875rem;
}
Here is a comparison between the sizing units: http://www.narga.net/understanding-font-sizing-in-css-em-px-pt-percent-rem/
This should get you pointed in the right direction.

Resources