Giter Club home page Giter Club logo

Comments (14)

donaldpcook avatar donaldpcook commented on July 20, 2024 1

I had a similar issue where the classes were being generated in the markup but the actual styles for pseudo classes were not. Realized that the issue was due to just opening the index.html file instead of running it on a server.

This may have been @davids701124 's issue. Perhaps we can include something in the readme regarding this?

from kss-node.

webholics avatar webholics commented on July 20, 2024

btn:hover is not a class. :hover is a pseudo state managed by the browser. kss.js included in the default template handles this problem by making the common pseudo classes explicitly available through those "pseudo-class-..." classes.

from kss-node.

davids701124 avatar davids701124 commented on July 20, 2024

I know that. What I mean is that the looks of those elements should stay on
hover, active or disable state. But they are not. I wonder because the
class names wrong or something.

On Feb 19, 2014 12:58 AM, "Mario Volke" [email protected] wrote:

btn:hover is not a class. :hover is a pseudo state managed by the
browser. kss.js included in the default template handles this problem by
making the common pseudo classes explicitly available through those
"pseudo-class-..." classes.

Reply to this email directly or view it on GitHub.

from kss-node.

davids701124 avatar davids701124 commented on July 20, 2024

This is the screenshot. The hover state should keep the background red.
screen shot 2014-02-19 at 9 48 42 am

from kss-node.

webholics avatar webholics commented on July 20, 2024

Seems like you are using an alternate styleguide template. In the original template it is working. See for example the button section in http://hughsk.io/kss-node/section-1.html

Maybe there's a problem in the template you are using.

from kss-node.

0x6a68 avatar 0x6a68 commented on July 20, 2024

Correct. Be sure you have the kss.js included in your template

from kss-node.

JohnAlbin avatar JohnAlbin commented on July 20, 2024

Looks like we need some template docs that explain this. https://github.com/kss-node/kss-node/wiki/Creating-Custom-Templates

from kss-node.

joeloverpeck avatar joeloverpeck commented on July 20, 2024

Was experiencing the same issue, and your suggestion worked like a charm. Pseudo classes do not work when opening from the the file directly -- must run the file from a server. I burned through most of a day trying to figure that out. Many thanks.

from kss-node.

phun-ky avatar phun-ky commented on July 20, 2024

Having a similar issue here:

  • Using kss-node 2.0.2
  • Using the template from kss-node --init with an extra CSS file
  • kss.js is loaded
  • Using this in the *.less file:
      // The breadcrumb
      //
      // .active - The active breadcrumb
      //
      // Markup:
      // <div id="crumbs">
      //   <nav>
      //     <span class="{$modifiers}">
      //       <a>Crumb 2</a>
      //     </span>
      //   </nav>
      // </div>
      //
      // Style guide: modules.crumbs.breadcrumb
      span {
        background: url('../img/crumb.svg') no-repeat center right;
        background-size: 4px 10px;
        color: #6A6A6A;

        font-family: @font-family-proximanova-semibold;
        font-size: 16px;
        font-weight: 400;
        padding: 1px 15px 0 0;
        margin-right: 20px;

        a {
          color: #6A6A6A;
          font-family: @font-family-proximanova-semibold;
          font-size: 16px;
          font-weight: 400;
          text-decoration: none;

          &:hover {
            color: #e75d47;
          }
        }

        &.active {
          background-image: none;
          color: @color-siostandard;
          display: inline-block;
          font-family: @font-family-proximanova-semibold;
          font-size: 28px;
          font-weight: 400;
          line-height: 40px;
          padding-right: 0;
          padding-top: 6px;
        }
      }

Serving the styleguide with http-server, everything is loaded , but no modifier is given as state:

ss

What could be wrong here? If I inspect the element and manually set .active class to the span-tag, it does with it should do..

from kss-node.

0x6a68 avatar 0x6a68 commented on July 20, 2024

@phun-ky try to change the {$modifiers} to {{modifier_class}}

from kss-node.

phun-ky avatar phun-ky commented on July 20, 2024

@johannestroeger that worked! now I just have the similar issue with :hover taking no effect:

// Link
//
// The actual breadcrumb link
//
// :hover - When users hover over the button
//
// Markup:
// <div id="crumbs">
//   <nav>
//     <span>
//       <a>Crumb 1</a>
//     </span>
//   </nav>
// </div>
//
// Style guide: modules.crumbs.breadcrumb.link
a {
  color: #6A6A6A;
  font-family: @font-family-proximanova-semibold;
  font-size: 16px;
  font-weight: 400;
  text-decoration: none;

  &:hover {
    color: #e75d47;
  }
}

EDIT: solved this by adding {{modifier_class}} to <a> in the markup example..

from kss-node.

0x6a68 avatar 0x6a68 commented on July 20, 2024

@phun-ky shouldn`t it be something like the following?

...
Markup: 
...
<a class="{{modifier_class}}">Crumb 1</a>
...

from kss-node.

phun-ky avatar phun-ky commented on July 20, 2024

@johannestroeger yes, found that out (ref edit in last comment). Must have missed it in the documentation. (if not in the documentation, can you add it, or make it clearer?)

from kss-node.

0x6a68 avatar 0x6a68 commented on July 20, 2024

actually it is defined, somehow not in kss-node, but at the original Specification

from kss-node.

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.