Skip to content

Support &[thing=""] syntax #91

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
mfeckie opened this issue Feb 12, 2021 · 2 comments
Closed

Support &[thing=""] syntax #91

mfeckie opened this issue Feb 12, 2021 · 2 comments

Comments

@mfeckie
Copy link
Contributor

mfeckie commented Feb 12, 2021

Do you have a sense of how difficult it would be to support this type of syntax ?

&[class$='link'] {`

I'm happy to put some work into it myself if you can point me in the right direction.

@kaj kaj changed the title Support &[thing="" syntax Support &[thing=""] syntax Feb 12, 2021
@kaj
Copy link
Owner

kaj commented Feb 12, 2021

Yes, that should be supported. It might be as simple as adding "$=" to the matched Attribute operators in the parser:

alt((tag("*="), tag("|="), tag("="))),

And I guess the same should go for ~= and ^=.

@kaj
Copy link
Owner

kaj commented Feb 12, 2021

Fixed in #92, Thanks!

@kaj kaj closed this as completed Feb 12, 2021
kaj added a commit that referenced this issue Feb 25, 2021
Progress: 2892 of 5945 tests passed in dart-sass compatibility mode.

### Breaking changes

Lots of things have been moved around.  See `Scope`, `Numeric`, and
`Function` in particular.

### Improvements

* Support `@use` of user-defined modules.  PR #96.
* Improve trigonometric precision by using f64 π rather than rational.
* Handle more peculiarities with atan2, pow, infinities and negative zero.
* Improve name lookups in scopes and modules, PR #87.
* new `struct Scope` replaces trait and three structs. PR #95.
* A color can be Hsla or Hwba as well as Rgba. PR #88, #89.
* Handle units in `@for` loops inside sass functions.
* Some types moved into `value` mod, imporoved docs. PR #90.
* Add support for `$=`, `~=` and `^=` in css attribute selectors.
  Issue #91, PR #92.
* A `Numeric` is a Number with a Unit.  Also hide NumValue enum. PR #93.
* The `SassFunction` type is now named `sass::Function`.
* Test suite sass-spec updated to 2021-02-18.
* Some cleanups.

Thanks to @mfeckie for #91/#92.

Tested with rustc 1.50.0 (cb75ad5db 2021-02-10),
rustc 1.48.0 (7eac88abb 2020-11-16),
rustc 1.46.0 (04488afe3 2020-08-24),
rustc 1.44.1 (c7087fe00 2020-06-17),
rustc 1.51.0-beta.3 (b631c914c 2021-02-24), and
rustc 1.52.0-nightly (a8486b64b 2021-02-24).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants