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

Add @media queries support #893

Closed
dannycolin opened this issue Jan 7, 2019 · 4 comments
Closed

Add @media queries support #893

dannycolin opened this issue Jan 7, 2019 · 4 comments
Assignees

Comments

@dannycolin
Copy link
Contributor

dannycolin commented Jan 7, 2019

This feature is to discuss about the possibility of adding CSS Media Queries support in Rasi Theming. Feel free to suggest, critic and expose other use cases you can think about. I'll update the use cases section accordingly.

Version

1.5.1

Configuration

https://gist.github.com/dannycolin/fe02588d5bf65bbade2573a3a439ab31

Launch Command

rofi -show drun

Steps to reproduce

  • add the following code to my theme config in ~/.config/rofi/themes/
inputbar {
  orientation: vertical;
}

@media (min-width: 900px) {
  inputbar {
    orientation: horizontal;
  }
}
  • Got a syntax error

What behavior you see

At the moment, we can't change the theme appearance based on the screen resolution. I got a syntax error since it's not yet implemented.

What behavior you expect to see

I would expect the possibility to change theme depending on screen resolution a media query (see the list below) based on the CSS Media Queries syntax.

Media queries

prefers-color-scheme

Change to dark/light theme based on OS and/or user config settings

* {
  --background-color: black;
)
@media (prefers-color-scheme: dark) {
  * {
    --background-color: white;
  }
}

{min, max}-width, {min, max}-height, portrait

Change CSS according to screen size and orientation

@media (min-width 1920px) { }
@media (portrait: landscape) { }

mode: mode-name

Give the ability to apply different CSS rules depending on the active mode

@media (mode: drun) {
  window {
    location: west;
    width: 20%;
  }
}
@media (mode: window) {
  window {
    location: center;
  }
  // hide window title and only show icons to reproduce the effect of Alt + Tab on some Desktop Env
}
@DaveDavenport DaveDavenport added the Incomplete Report - Please follow the guidelines Your report is incomplete and does not follow the guidelines, you may not expect an answer label Jan 7, 2019
@dannycolin
Copy link
Contributor Author

@DaveDavenport ah my bad I didn't copy/paste the whole text from vim :). If you need more informations on that feature request let me know.

@DaveDavenport DaveDavenport removed the Incomplete Report - Please follow the guidelines Your report is incomplete and does not follow the guidelines, you may not expect an answer label Jan 8, 2019
@DaveDavenport
Copy link
Collaborator

Interesting use-case. Can see the use of this. Not sure how feasible this is in the current architecture, will need to investigate.

@DaveDavenport DaveDavenport self-assigned this Jan 8, 2019
DaveDavenport added a commit that referenced this issue Aug 19, 2019
@DaveDavenport
Copy link
Collaborator

Initial implementation on separate branch

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants