Skip to content

Elliptical border-radius is interpreted as expression. #16

Closed

Description

@tomlokhorst

I have the following CSS:

button {
  border-radius: 12px / 10px;
}

When I run this through the dotless compiler, the slash in the elliptical border-radius is seen as an operator.

The previous example gets compiled to:

button {
  border-radius: 1.2;
}

Which is not what I wanted.

Activity

  1. jamesfoster commented on Feb 9, 2011

    @jamesfoster
    Member
  2. tomlokhorst commented on Feb 10, 2011

    @tomlokhorst
    Author

    That doesn't work; border-radius: 12px/10px; still gets compiled to border-radius: 1.2;.

    And if I try the example from the the documentation of the Shorthand method (font-size: small/12pt;), I get an error: Cannot apply operator / to the left hand side: small.

  3. jamesfoster commented on Feb 14, 2011

    @jamesfoster
    Member

    font-size: small/12pt; is not valid. the shorthand form is font: small/12pt; which is equivalent to

    font-size: small;
    line-height: 12pt;
    

    here is the line which restricts it to the font rule.

    https://github.com/dotless/dotless/blob/master/src/dotless.Core/Parser/Parsers.cs#L668

    I guess we could expand that to rules where the name contains "radius" ?

    What do you think?

  4. tomlokhorst commented on Feb 15, 2011

    @tomlokhorst
    Author

    Checking for "radius" would be an option, although it wouldn't be my ideal solution. I guess that would also mean I can no longer use division expression in border-radius.

    I don't know if it is possible, as you can guess from my "font" example; I'm not a CSS expert. But would it be possible to check for the units?

    Currently, 12/10px is compiled to 1.2px, but 12px/10px is compiled to simply 1.2. Do you think it the presence of the units is enough to signal that this is not an expression to be evaluated? Or would that be to confusing?

  5. lukeapage commented on Aug 24, 2011

    @lukeapage
    Member

    Similiar issues in less.js (also unresolved)

    less/less.js#146
    less/less.js#206

    I like the fact that less is a superset of css - and this particular bug means less compiles normal css into something unexpected.

  6. rytmis commented on Mar 1, 2015

    @rytmis
    Contributor

    "Strict math mode" for dotless would be the thing that resolves this one, too.

  7. rytmis commented on Mar 22, 2015

    @rytmis
    Contributor

    2e10803 introduces Strict Math for dotless. I've no idea as to how well this compares to less.js, but it's a start.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions