Code Monkey home page Code Monkey logo

Comments (5)

ijager avatar ijager commented on May 18, 2024

@laserus I think this is because you shouldn't put the styles in app { } or demo {} brackets, as the styles are encapsulated within the component (in the component template there are no <app> or <demo> tags, those are in the parent component).

If you want styles to work like this you should set encapsulation: ViewEncapsulation.None in your component, but that is probably not what you want since the styles will apply globally.

The boilerplate project should probably be changed to avoid confusion.

from angular-meteor-base.

laserus avatar laserus commented on May 18, 2024

@ijager Yes, I guessed that also, but as they present in this demo repo, I thought there still could be some meaning for them.

Then another question:

If I wat to make demo.component background all red what should I do in the file, except polluting with classes? I cannot write to demo.component.scss this:

background-color: red;

I need some selector...

* {
  background-color: red;
}

Is there a good solution? or only class way is the best:

.demo {
  background-color: red;
}

and then add this class to template

from angular-meteor-base.

ijager avatar ijager commented on May 18, 2024

Hi @laserus ,

I think the simplest solution is indeed to wrap your component in a div with a .demo class for example. It feels redundant to me too.

The only workarounds I see are to define the demo {} css in the parent component or in some global style sheet. But then the component is not self-containing..

from angular-meteor-base.

laserus avatar laserus commented on May 18, 2024

Ok, understood. Thanks!

from angular-meteor-base.

ijager avatar ijager commented on May 18, 2024

I found a better solution here

You should be able to use :host

:host {
  display: block;
  width: 100%;
  height: 100%;
}

from angular-meteor-base.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.