schultek / jaspr

Modern web framework for building websites in Dart. Supports SPAs, SSR and SSG.
https://jasprpad.schultek.de
MIT License
1.07k stars 65 forks source link

fix: Selector.chain() not producing the desired output #122

Closed i-am-ijaz closed 11 months ago

i-am-ijaz commented 11 months ago

Description

Selector.chain not producing the desired output

Steps To Reproduce

  1. I want to implement the style like this using the StyleRules image
  2. I applied the style using the Selector.chain method image
  3. After inspecting the web page. I came to know that it producing the chain selector without any spacing (See the bottom right corner of the image) Sorry for this bad screenshot: image

Expected Behavior

There must be a space between the chain of selectors otherwise it would not work

schultek commented 11 months ago

Sorry this is actually not a bug.

You can use Selector.combine instead of .chain.

Combine is for selecting child elements (e.g. div #main -> a element with the id 'main' that is a child of a div) Chain is for having multiple selectors for a single element (e.g. div#main -> a div with the id 'main')

This is totally on me since the code is not documented anywhere. This is on the long list of todos :) Also I guess the naming could make more sense the way around, maybe I change this.