Skip to content
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

@media #7

Closed
JonDum opened this issue May 30, 2014 · 13 comments
Closed

@media #7

JonDum opened this issue May 30, 2014 · 13 comments
Labels

Comments

@JonDum
Copy link
Contributor

JonDum commented May 30, 2014

So @media tags aren't rendering so well right now.

input:

@media only screen and (max-width: 998px) {
  .page.grid {
    padding: 0% 4%;
  }
}

output:

@media
  only
    screen
      and
        (max-width
          &:
            998px)
              .page.grid {
    padding 0% 4%

It looks like the code is treating the spaces as additional selectors because it's getting through to line 109 selectors = selector.split(/[\s]+/);

Maybe we should add another check to the if statement on line 99 to see if the selector starts with @media then process the contents of that block recursively?

The way it is now doing that recursively would require a lot of rewriting. Maybe there's a better way. What are your thoughts?

@dciccale
Copy link
Owner

I think your solution is a good one, we could make a method to sub-process that line of the @media and return the stuff. So that we have to call that method inside the ìf` you are talking and things should keep simple.

Anyway I will think about other solutions.. thanks

@JaKXz
Copy link

JaKXz commented Jan 27, 2015

I'm seeing this issue as well.

@dciccale
Copy link
Owner

Seems a pretty good fix to do by adding an additional check. Didn't have the time yet to implement it. I will try it whenever I have time for this, please feel free to contribute

@KyleKing
Copy link
Contributor

I'm still having this issue as well, given:

@media(min-width:1200px) {
    .timeline>li {
        min-height: 170px;
    }
}

Css2stylus outputs:

@media(min-width
  &:1200px)
    .timeline>li {
        min-height 170px

@ghost
Copy link

ghost commented Jun 24, 2015

Still having this issue too

@media
    (max-width
      &:
        767px)
          before {
        left 40px

ul
  &.timeline
    & > li
      margin-bottom 20px
      position relative
      width 100%
      float left
      clear left

@dciccale
Copy link
Owner

this needs to be addressed in a special case. open to contributions :)

will try to fix it at some point

@JonDum
Copy link
Contributor Author

JonDum commented Jul 31, 2015

Honestly, it's not a feature, but a straight up bug. :|

@dciccale
Copy link
Owner

well as I see it is a feature. because this version i never made any special implementation for handling media queries. so if support is something is needed to be implemented (not fixed) is a feature. not a bug

@dciccale
Copy link
Owner

and what i meant above in my previous comment by "fix" was about fixing the github issue by implementing this feature.

thanks for the contribution

@NeXTs
Copy link

NeXTs commented Aug 12, 2015

+1
I also faced @media issue

@martpie
Copy link

martpie commented Oct 28, 2015

Hi, any news on this ?

@dciccale
Copy link
Owner

i am pretty busy to handle this now, please feel free to contribute.

On Wed, Oct 28, 2015 at 10:08 AM, Pierre de la Martinière <
notifications@github.com> wrote:

Hi, any news on this ?


Reply to this email directly or view it on GitHub
#7 (comment)
.

@KyleKing
Copy link
Contributor

I just submitted a pull request that should fix this issue

dciccale added a commit that referenced this issue Dec 13, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants