question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add ngeo scope to CSS classes

See original GitHub issue

CSS class names used in ngeo are not enough scoped and thus will cause conflicts.

For example, for the search directive, we use the class “.search” and the CSS defines a rule like:

.search input {
  height: 100%;
}

This conflicts with any application or component using an input in a search class.

As a consequence, ngeo classes should be prefixed like this:

.ngeo-search input {
  height: 100%;
}

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:21 (21 by maintainers)

github_iconTop GitHub Comments

3reactions
adubecommented, Aug 31, 2016

@gberaudo or @sbrunner I would like to clarify my intentions. Please, let me know if you agree.

First, anything that’s part of GeoMapFish should have a gmf- prefix instead of ngeo-.

Also, any class that is defined alongside a directive definition should simply be removed and the definition should use the tag name instead. For example, the .search class name is used here:

    <gmf-search gmf-search-map="mainCtrl.map"
      class="search"
      gmf-search-datasources="mainCtrl.searchDatasources"
      gmf-search-coordinatesprojections="mainCtrl.searchCoordinatesProjections"
      gmf-search-colorchooser="true"
      gmf-search-clearbutton="true">
    </gmf-search>

And the definition currently looks like this (in the .less files):


.search {

  ...

  .gmf-search {
    background-color: @map-tools-bg-color;
    border: 1px solid @border-color;
    padding: 0 @app-margin;
    height: @map-tools-size;
    position: relative;
  }

  ...

Could be changed like this:

    <gmf-search gmf-search-map="mainCtrl.map"
      gmf-search-datasources="mainCtrl.searchDatasources"
      gmf-search-coordinatesprojections="mainCtrl.searchCoordinatesProjections"
      gmf-search-colorchooser="true"
      gmf-search-clearbutton="true">
    </gmf-search>
gmf-search {

  ...

  .gmf-search {
    background-color: @map-tools-bg-color;
    border: 1px solid @border-color;
    padding: 0 @app-margin;
    height: @map-tools-size;
    position: relative;
  }

  ...

What do you think ?

0reactions
sbrunnercommented, Sep 14, 2016

Many thanks @adube

Read more comments on GitHub >

github_iconTop Results From Across the Web

scope - CSS: Cascading Style Sheets - MDN Web Docs
The :scope CSS pseudo-class represents elements that are a reference point for selectors to match against.
Read more >
Scope of CSS class - html - Stack Overflow
It takes the style of the stylesheets added latest in your html . Try placing your stylesheet link at the very top.
Read more >
Saving the Day with Scoped CSS
To get Scoped CSS working I simply add a little bit of logic to content.php and content-single.php to look for the custom field...
Read more >
Scope Reference — highlight.js 11.7.0 documentation
Some scope names above have a . in them. We use this notation to specify sub-scopes. In the generated HTML this will output...
Read more >
Use CSS to Style the Experience - PTC Support
1. Click Application under STYLES. · 2. Now that the CSS classes have been added to the application styles, you can add them...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found