i know SASS/SCSS and I know whats object oriented, but can I say that SASS is a way to make CSS object oriented? Please correct me if I am wrong.
It's an interesting question as SASS/SCSS doesn't exactly determine the ability to make CSS object oriented. The CSS you write will. As you know it is simply a layer to pre compile CSS.
You could definitely and rightly so state that by using SASS it makes it easier to create object oriented-like css. It definitely helps as you can individualise classes into files, extend, include etc. and you can import them which helps in creating a closer to modular environment than regular CSS provides.
As SASS compiles to CSS, you really could achieve the same Object Oriented classes without it. But it may help you organise the objects.
I think it is not really object oriented, but you can use some functions like other progrmamming languages.
variable
nesting
mixin (function)
opearators (+ - * /)
These help you easier to reuse and maintain css code
Related
I am trying to hardcode a prototype from XD. I just downloaded Atom to get started, however I am struggling with getting my CSS to work, since I don't think it is normalized. I am not sure how to do this. Any help?
I guess you are talking about Adobe XD.
Imo, the best way would be to write a dedicated CSS file, and have it linked into your hardcoded prototype (like this: https://www.w3schools.com/css/css_howto.asp).
As my Angular 2/4 app is growing more and more I have more than a hundred components, and each component has its CSS file.
Do you think it would be better to declare a CSS file in index.html and have all my styles there?
As I could apply specific CSS rules to a component by referencing its selector...
The CSS/SCSS/LESS-Files (depending on what you use) in default follow some convention, starting with your src/styles.css in the root of your Source-Folder.
In the src/app/app.component.css you'll dive on step "deeper". Finally you got the CSS-Files for each of your components.
I think it is meant to be like that:
Global styles, that apply to all of your Applications-Styles (like html and body style-definitions) should be declared in the src/styles.css. A bit more app specific, yet global styles for the Angular-App itself should be declared in src/app/app.component.css.
Specific Definitions that apply only to a single component should be declared directly in the components css-file.
This way you can keep your CSS organized and follow along the DRY (Don't repeat yourself) rule :)
regards
imo you should have separate css files for each component but also one global css file for shared styles
Having separate file for each component is a very good idea.
To maintain a scalable project with nice and clean CSS architecture I would recommend something like ITCSS
https://www.xfive.co/blog/itcss-scalable-maintainable-css-architecture/
Consider using preprocessor such as SASS and LESS if u are not using them yet.
I have been working on polymer/designer off late. I wanted to mess around, add more components etc. I am still learning polymer and I need some help.
I need to know the difference between the components and the elements. I know what components are.
Clone this: https://github.com/Polymer/designer
Run it locally. I need to understand how the code works for this. Check the components and the elements folders. And also the index file. A simple explanation is to how it is all connected and rendered etc.
As far as I understand it components are the building blocks for elements. As you can see in the elements folder you need at least one component for your element. In general I think the term might be interchangeable since components have dependencies on other components as well so they are actually elements as well. I think you should worry too much about the terminology :)
Lift is a fun web framework to work with. However, it's really hard for newbies to get the html/xml codes out of snippet codes. Is there a recommended way to do it?
If you use the CSS Selector Transforms (please see http://simply.liftweb.net/index-7.10.html#toc-Section-7.10 ) rather than the Helpers.bind() stuff, you'll find little or no markup in your Scala code.
Thanks.
Just
try to keep the ammount of snippet html as small as possible. For example if there is some static code inside your snippet you dont need there you could just move it into the html file.
and
try to keep it style independent such that the frontend designer can do his job just by editing the html/css/js files.
I'm working on a project in Flash CS4/AS3 and I have a document class set up but I am wondering about using that, as opposed to frame-based scripting. Most of what I have seen so far deals with how to create them, but doesn't offer much about why or when to use them.
I know I can also pull in other classes beyond the document class but, again, why and when?
Could I get some input from you fine people out there on usage/best practice, etc?
Thanks
If this is just a simple demo or a movie, you can use the time line.
But if you're going to make a program, with classes, you should have a document class.
A document class is the main class of your programs. it's actually your initializer of all the program's processes and components, and it's simply more proper and similar to other programming languages.
Plus, it's in a different file, and it is easier to edit it this way.
Also, your doc-class will be a class and not just code in the air.. it also has auto-complete in CS5.