Comments (11)
Yes, I do like my work there myself :P
I think we need to dig a little bit deeper on the fallback support because there are some people who do wrapper classes and some who would prefer a separate IE stylesheet and we need a way to accommodate both/not force one.
Take a look at the IE branch I made for how I was implementing the IE stylesheet version. Maybe we add both as an option? I also think the semantics are better served like the following:
@mixin breakpoint($breakpoint-variable, $media, $no-query-wrapper-class:false) {
@if $no-query-wrapper-class != false {
.#{$no-query-wrapper-class} & {
@content;
}
}
... the rest of breakpoint ...
}
I'm a big proponent of calling all fallback stuff "no query" to drill home the fact that these changes should only target things w/no query support, not "ie", and that wrapper classes don't wrap the queries and are meant for when there is no query support.
from breakpoint.
Also like calling it 'no-query'.
I'm thinking of setting a keyword to the wrapper to accomodate that use.
@mixin breakpoint($breakpoint-variable, $media, $no-query-wrapper-class:false) {
@if $no-query-wrapper-class != false {
@if $no-query-wrapper-class == 'no-wrapper' {
@content;
}
@else {
.#{$no-query-wrapper-class} & {
@content;
}
}
}
... the rest of breakpoint ...
}
from breakpoint.
I like where this is going. However I am afraid that, with this method, I would end up with one huge stylesheet that serves both HTML5 browsers and old IE. Is there anyway this method can incorporate the use of rendering IE/wrapper styles in an external stylesheet?
from breakpoint.
Have no fear, this is still under obstruction and I wouldn't dare leave your use case out :p
~ Sam Richard
http://snug.ug
On Thursday, August 9, 2012 at 11:27 AM, Oliver Joseph Ash wrote:
I like where this is going. However I am afraid that, with this method, I would end up with one huge stylesheet that serves both HTML5 browsers and old IE. Is there anyway this method can incorporate the use of rendering IE/wrapper styles in an external stylesheet (https://github.com/canarymason/breakpoint/pull/8)?
—
Reply to this email directly or view it on GitHub (https://github.com/canarymason/breakpoint/issues/12#issuecomment-7617287).
from breakpoint.
I think I might prefer that everything is in one stylesheet since I can't assume that lack of media query support == IE
from breakpoint.
We're designing this as a "no query" solution as opposed to an "ie" solution, but we need to account for all use cases.
~ Sam Richard
http://snug.ug
On Friday, August 10, 2012 at 7:25 PM, Paul Young wrote:
I think I might prefer that everything is in one stylesheet since I can't assume that lack of media query support == IE
—
Reply to this email directly or view it on GitHub (https://github.com/canarymason/breakpoint/issues/12#issuecomment-7661475).
from breakpoint.
So I guess here's the most pressing question I have.
There appears to be two distinct use cases, one where a user would want to print out a separate no-query only stylesheet, and one where a user would like to wrap no-query styles in a wrapper class in the same stylesheet. My question is, is there real third usecase where a user would like to print out a separate no-query stylesheet with wrapped classes?
from breakpoint.
If you'd like to test this feature, check out this branch. I know I called the branch IE, deal with it, it's the no-query branch.
Basically, the code should cover all three usecases, adds one new variable input to the Breakpoint mixin, and adds two breakpoint flags.
Both of the new breakpoint flags, $breakpoint-no-queries
and $breakpoint-no-query-wrappers
default to false
, toggling them to true
activates them. For the purposes of clarity in the preceding code samples, I'm including both flags even though the false
flags are not explicitly needed.
Wrapping Selector Fallback, Same Stylesheet
// style.scss
$breakpoint-no-queries: false;
$breakpoint-no-query-wrappers: true;
#foo {
background: red;
@include breakpoint(567px, $no-query: '.no-mqs') {
background: green;
}
}
/* style.css */
#foo {
background: red;
}
.no-mqs #foo {
background: green;
}
@media (min-width: 567px) {
#foo {
background: green;
}
}
No Wrapping Selector, Separate Output
// _layout.scss
#foo {
background: red;
@include breakpoint(567px, $no-query: true) {
background: green;
}
}
// style.scss
$breakpoint-no-queries: false;
$breakpoint-no-query-wrappers: false;
@import 'layout';
// no-mq.scss
$breakpoint-no-queries: true;
$breakpoint-no-query-wrappers: false;
@import 'layout';
/* style.css */
#foo {
background: red;
}
@media (min-width: 567px) {
#foo {
background: green;
}
}
/* no-mq.css */
#foo {
background: red;
background: green;
}
Wrapping Selector, Separate Output
// _layout.scss
#foo {
background: red;
@include breakpoint(567px, $no-query: '.no-mq') {
background: green;
}
}
// style.scss
$breakpoint-no-queries: false;
$breakpoint-no-query-wrappers: false;
@import 'layout';
// no-mq.scss
$breakpoint-no-queries: true;
$breakpoint-no-query-wrappers: true;
@import 'layout';
/* style.css */
#foo {
background: red;
}
@media (min-width: 567px) {
#foo {
background: green;
}
}
/* no-mq.css */
.no-mq #foo {
background: red;
background: green;
}
Thoughts?
from breakpoint.
Perfect.
Oliver
On 11 Aug 2012, at 19:30, Snugug [email protected] wrote:
If you'd like to test this feature, check out this branch. I know I called the branch IE, deal with it, it's the no-query branch.
Basically, the code should cover all three usecases, adds one new variable input to the Breakpoint mixin, and adds two breakpoint flags.
Both of the new breakpoint flags, $breakpoint-no-queries and $breakpoint-no-query-wrappers default to false, toggling them to true activates them. For the purposes of clarity in the preceding code samples, I'm including both flags even though the false flags are not explicitly needed.
Wrapping Selector Fallback, Same Stylesheet
// style.scss
$breakpoint-no-queries: false;
$breakpoint-no-query-wrappers: true;#foo {
background: red;
@include breakpoint(567px, $no-query: '.no-mqs') {
background: green;
}
}
/* style.css */
#foo {
background: red;
}.no-mqs #foo {
background: green;
}@media (min-width: 567px) {
#foo {
background: green;
}
}
No Wrapper Class, Separate Output// _layout.scss
#foo {
background: red;
@include breakpoint(567px, $no-query: true) {
background: green;
}
}
// style.scss
$breakpoint-no-queries: false;
$breakpoint-no-query-wrappers: false;@import 'layout';
// no-mq.scss
$breakpoint-no-queries: true;
$breakpoint-no-query-wrappers: false;@import 'layout';
/* style.css */
#foo {
background: red;
}@media (min-width: 567px) {
#foo {
background: green;
}
}
#foo {
background: red;
background: green;
}
Wrapping Selector, Separate Output// _layout.scss
#foo {
background: red;
@include breakpoint(567px, $no-query: '.no-mq') {
background: green;
}
}
// style.scss
$breakpoint-no-queries: false;
$breakpoint-no-query-wrappers: false;@import 'layout';
// no-mq.scss
$breakpoint-no-queries: true;
$breakpoint-no-query-wrappers: true;@import 'layout';
/* style.css */
#foo {
background: red;
}@media (min-width: 567px) {
#foo {
background: green;
}
}
.no-mq #foo {
background: red;
background: green;
}
Thoughts?—
Reply to this email directly or view it on GitHub.
from breakpoint.
I haven't tested it yet, but I like this way this looks. Let's plan to move this into master once I do.
from breakpoint.
this is done, and in master
from breakpoint.
Related Issues (20)
- How to import breakpoint with webpack? HOT 5
- Sourcemaps Issue Stylesheet could not be loaded...
- W3C error on min-aspect-ratio and max-aspect-ratio
- Spelling mistake in error message in _legacy-settings.scss
- component/sass/styles.scss (Line 3: File to import not found or unreadable: breakpoint.
- Consider using >=0.8.2 for eyeglass "needs"
- Can't seem to extend a placeholder or class which consists solely of media query content coming from Breakpoint HOT 2
- Typo in documentation
- Installation for breakpoint doesn't work
- Can media queries be grouped in css? HOT 1
- eyeglass usage notes
- Using "only screen" with the mixin HOT 1
- can't override default variables HOT 1
- Dual license clarification HOT 2
- Sass needs to be replaced as it is EoL HOT 1
- Are Level 4 Media Queries supported??? HOT 3
- licence MIT AND/OR GPL HOT 1
- breakpoint doesn't work with sass 1.49.9 because of breaking change: slash as division HOT 5
- Breakpoint v3.0.0 is incompatible with Python libsass
- hover: hover doesn't work because of missing value in variable
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from breakpoint.