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

refactor: remove --ie feature support #448

Merged
merged 1 commit into from
Jul 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ module.exports = function (grunt) {
atomizer: {
docs: {
options: {
ie: false,
configFile: './config/atomic-config.js',
configOutput: './build/atomizer.json',
},
Expand Down
63 changes: 7 additions & 56 deletions docs/assets/atomic.css
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
.Bgc\(\#000\.6\) {
background-color: rgba(0,0,0,.6);
}
.Bgc\(\#0280ae\), .Bgc\(brandColor\) {
.Bgc\(\#0280ae\), .Bgc\(brandColor\), .Bgc\(\#0280ae\)\:h:hover {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@src-code I'm not sure why this collapsed into one rule

background-color: #0280ae;
}
.Bgc\(\#0280ae\.5\) {
Expand All @@ -61,9 +61,6 @@
.Bgc\(t\) {
background-color: transparent;
}
.Bgc\(\#0280ae\)\:h:hover {
background-color: #0280ae;
}
.menu-on .menu-on_Bgp\(end_t\) {
background-position: right 0;
}
Expand Down Expand Up @@ -97,25 +94,22 @@
.C\(\#f2438c\) {
color: #f2438c;
}
.C\(\#fff\) {
.C\(\#fff\), .C\(\#fff\)\:h:hover {
color: #fff;
}
.C\(--primary-color\) {
color: var(--primary-color);
}
.C\(\#fff\)\:h:hover {
color: #fff;
}
.D\(b\), .home .home_D\(b\), .menu-on .menu-on_D\(b\), .open .open_D\(b\) {
display: block;
}
.D\(f\) {
display: flex;
}
.D\(ib\), .IbBox, a[class*=LineClamp], .Row {
.D\(ib\), .Ell:after, .IbBox, a[class*=LineClamp], a[class*=LineClamp]:after, .Row {
display: inline-block;
}
.D\(n\), .foo .foo_D\(n\), .foo + .foo\+D\(n\), .foo > .foo\>D\(n\), .foo ~ .foo\~D\(n\), .home .home_D\(n\) {
.D\(n\), .D\(n\)\:h:hover, .foo .foo_D\(n\), .foo + .foo\+D\(n\), .foo > .foo\>D\(n\), .foo ~ .foo\~D\(n\), .foo:hover .foo\:h_D\(n\), .home .home_D\(n\) {
display: none;
}
.D\(tb\) {
Expand All @@ -130,12 +124,6 @@
.D\(tbhg\) {
display: table-header-group;
}
.D\(n\)\:h:hover {
display: none;
}
.foo:hover .foo\:h_D\(n\) {
display: none;
}
.home .home_D\(b\)\! {
display: block !important;
}
Expand Down Expand Up @@ -307,7 +295,7 @@
.home .home_Ov\(v\) {
overflow: visible;
}
.Ov\(h\), .Ell, .Hidden, [class*=LineClamp] {
.Ov\(h\), .Ell:after, .Ell, .Hidden, [class*=LineClamp], a[class*=LineClamp]:after {
overflow: hidden;
}
.P\(0\) {
Expand Down Expand Up @@ -374,10 +362,7 @@
.Ta\(start\) {
text-align: left;
}
.Td\(n\) {
text-decoration: none;
}
.Td\(n\)\:h:hover {
.Td\(n\), .Td\(n\)\:h:hover {
text-decoration: none;
}
.Tt\(u\) {
Expand Down Expand Up @@ -452,25 +437,10 @@
.BfcHack {
width: 1600px;
}
.BfcHack, .Row {
*width: auto;
}
.BfcHack, .Cf, .IbBox, a[class*=LineClamp], .Row {
zoom: 1;
}
.Cf:before, .Cf:after {
content: " ";
display: table;
}
.Cf:after {
clear: both;
}
.Ell:after {
.Ell:after, a[class*=LineClamp]:after {
content: ".";
font-size: 0;
visibility: hidden;
display: inline-block;
overflow: hidden;
height: 0;
width: 0;
}
Expand All @@ -481,31 +451,18 @@
}
.Hidden {
position: absolute !important;
*clip: rect(1px 1px 1px 1px);
clip: rect(1px,1px,1px,1px);
padding: 0 !important;
height: 1px !important;
width: 1px !important;
}
.IbBox, a[class*=LineClamp] {
*display: inline;
}
[class*=LineClamp] {
display: -webkit-box;
-webkit-box-orient: vertical;
}
a[class*=LineClamp] {
display : -webkit-box;
}
a[class*=LineClamp]:after {
content: ".";
font-size: 0;
visibility: hidden;
display: inline-block;
overflow: hidden;
height: 0;
width: 0;
}
.LineClamp\(2\,54px\) {
-webkit-line-clamp: 2;
}
Expand All @@ -515,18 +472,12 @@ a[class*=LineClamp]:after {
.LineClamp\(3\,54px\) {
-webkit-line-clamp: 3;
}
.Row {
*display: block;
}
.StretchedBox {
top: 0;
right: 0;
bottom: 0;
left: 0;
}
.Zoom {
zoom: 1;
}
@media screen and (max-width:700px) {
.D\(n\)--xs {
display: none;
Expand Down
2 changes: 1 addition & 1 deletion docs/assets/js/main.js

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions docs/assets/js/main.js.LICENSE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,16 @@
* LICENSE file in the root directory of this source tree.
*/

/**
* @license React
* react-jsx-runtime.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

/**
* @license React
* react.production.min.js
Expand Down
2 changes: 1 addition & 1 deletion docs/assets/js/main.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/assets/main.css

Large diffs are not rendered by default.

15 changes: 4 additions & 11 deletions docs/guides/helper-classes.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,6 @@ title: Helper classes

<p class="noteBox warning">Note that this is a hack and may break if the content of the box is too large or if the box is next to floats.</p>

<p class="noteBox info">Atomizer plugs <code>zoom:1</code> along with <code>overflow:hidden</code> whenever you use the class <code>Ov(h)</code>. This is because <code>overflow:hidden</code> does not create a block-formatting context in old IE but <code>zoom</code> does.</p>

{% include subhead.html tag="h2" title="<code>Cf</code> (Clearfix)" %}

<p>Use <code>Cf</code> for <a href="http://yuiblog.com/blog/2010/09/27/clearfix-reloaded-overflowhidden-demystified/">clearfix</a>.</p>
Expand Down Expand Up @@ -94,13 +92,12 @@ title: Helper classes

{% highlight css %}
display: inline-block;
*display: inline;
zoom: 1;
vertical-align: top;{% endhighlight %}
vertical-align: top;
{% endhighlight %}

{% highlight html %}
<div class="IbBox W(50%) Ta(c) Bgc(#0280ae.5) C(#fff)">Box-1</div>
<div class="IbBox W(50%) Ta(c) Bgc(#0280ae) C(#fff)">Box-2</div>
<div class="IbBox W(50%) Ta(c) Bgc(#0280ae.5) C(#fff)">Box-1</div><!--
--><div class="IbBox W(50%) Ta(c) Bgc(#0280ae) C(#fff)">Box-2</div>
{% endhighlight %}

<p>Example:</p>
Expand Down Expand Up @@ -175,10 +172,6 @@ left: 0;
<div class="StretchedBox Bgc(#0280ae) P(10px) C(#fff)">I am a box with an intrinsic aspect ratio</div>
</div>

{% include subhead.html tag="h2" title="<code>Zoom</code>" %}

<p>Use the class <code>Zoom</code> if you support old versions of IE and need to <a href="http://www.satzansatz.de/cssd/onhavinglayout.html">give a box a layout</a>.</p>

<hr class="Mt(50px)">

<ol id="footnote" class="ol-list">
Expand Down
8 changes: 3 additions & 5 deletions docs/tutorials/grid-system.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ title: Grid system

<p>This styling has great browser support <a href="#footnote">[1]</a> and it is direction-friendly (boxes are displayed according to <code>ltr</code> / <code>rtl</code> contexts).</p>

<p>When creating inline-block constructs, you should use the helper class (<code>IbBox</code>) instead of <code>D(ib)</code> because the former gives you old-IE support plus vertical-alignment (<code>top</code>) for free.</p>
<p>When creating inline-block constructs, you should use the helper class (<code>IbBox</code>) instead of <code>D(ib)</code> because the former gives you vertical-alignment (<code>top</code>) for free.</p>

{% include subhead.html tag="h4" title="Example" %}

Expand All @@ -43,11 +43,10 @@ title: Grid system
<p data-height="190" data-theme-id="12469" data-slug-hash="emMPaw" data-default-tab="result" data-user="thierry" class='codepen'>See the Pen <a href='http://codepen.io/thierry/pen/emMPaw/'>emMPaw</a> by Thierry (<a href='http://codepen.io/thierry'>@thierry</a>) on <a href='http://codepen.io'>CodePen</a>.</p>

<div class="noteBox warning">
<p><strong>3 things to be aware of when creating <code>inline-block</code> constructs</strong>:</p>
<p><strong>Some things to be aware of when creating <code>inline-block</code> constructs</strong>:</p>
<ol class="ol-list">
<li>white-space between nodes in the markup creates space between boxes, so make sure to address this by either removing that space altogether, using html comments (<code>&lt;!-- --&gt;</code>), or implementing some other trick like the one used by <a href="http://purecss.io/grids/">PureCSS</a>.</li>
<li><code>vertical-align:top</code> is needed to make sure all boxes are top aligned (<code>IbBox</code> takes care of #2 and #3).</li>
<li>IE7 <em>doesn&#39;t support</em> <code>display:inline-block</code> but Atomizer takes care of this behind the scenes <a href="#footnote">[1]</a>.</li>
<li><code>vertical-align:top</code> is needed to make sure all boxes are top aligned (<code>IbBox</code> takes care of this).</li>
</ol>
</div>

Expand Down Expand Up @@ -143,6 +142,5 @@ title: Grid system
<hr class="Mt(50px)">

<ol id="footnote" class="ol-list">
<li>Atomizer provides a patch for oldIE <a href="#footnote-1">[↩]</a>.</li>
<li>Atomizer relies on <code>start</code> and <code>end</code> instead of <code>left</code> and <code>right</code> which allows the usage of the <strong>same</strong> classes regardless of script context <a href="#footnote-2">[↩]</a>.</li>
</ol>
1 change: 0 additions & 1 deletion packages/atomizer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ Usage: atomizer [options] [path]
-w, --watch=[target] rebuilds when changes are detected in the file, directory, or glob (argument may be passed multiple times and is parsed for Atomic CSS classes)

--rtl swaps `start` and `end` keyword replacements with `right` and `left`.
--ie adds old IE hacks to the output.
--exclude=[pattern] pattern to exclude file to be scanned
--bump-mq increases specificity of media queries a small amount
--verbose show additional log info (warnings).
Expand Down
7 changes: 1 addition & 6 deletions packages/atomizer/bin/atomizer
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ program
.option('--exclude [pattern]', 'excluded file pattern', collect, [])
.option('--rtl', 'swaps `start` and `end` keyword replacements with `right` and `left`')
.option('--bump-mq', 'increases specificity of media queries a small amount')
.option('--ie', 'adds old IE hacks to the output')
.option('--ie', '[deprecated] no longer used')
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing this option completely, breaks the command, so leaving it for now

.option('--verbose', 'show additional log info (warnings)')
.option('--quiet', 'hide processing info')
.parse(process.argv);
Expand Down Expand Up @@ -204,11 +204,6 @@ if (typeof programOpts.helpersNamespace !== 'undefined') {
options.helpersNamespace = programOpts.helpersNamespace;
}

// Options: IE
if (typeof programOpts.ie !== 'undefined') {
options.ie = true;
}

if (programOpts.watch && programOpts.watch.length) {
var buildTriggerState = { files: {} };
var watcher = chokidar.watch(programOpts.watch)
Expand Down
19 changes: 1 addition & 18 deletions packages/atomizer/src/atomizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -351,22 +351,6 @@ Atomizer.prototype.parseConfig = function (config/*:AtomizerConfig*/, options/*:
for (const prop in treeo.declarations) {
if (values) {
values.forEach((value, index) => {
// plug IE hacks for know properties
if (options.ie) {
// block formatting context on old IE
/* istanbul ignore else */
if ((prop === 'display' && value === 'inline-block') || (prop === 'overflow' && value !== 'visible')) {
treeo.declarations.zoom = 1;
}
/* istanbul ignore else */
if (prop === 'display' && value === 'inline-block') {
treeo.declarations['*display'] = 'inline';
}
/* istanbul ignore else */
if (prop === 'opacity') {
treeo.declarations.filter = `alpha(opacity=${ parseFloat(value, 10) * 100 })`;
}
}
if (value !== null && treeo.declarations) {
// value could be an object for custom classes with breakPoints
// e.g.
Expand Down Expand Up @@ -471,8 +455,7 @@ Atomizer.prototype.getCss = function (config/*:AtomizerConfig*/, options/*:CSSOp
banner: '',
bumpMQ: false,
namespace: null,
rtl: false,
ie: false
rtl: false
}, options);

// validate config.breakPoints
Expand Down
36 changes: 3 additions & 33 deletions packages/atomizer/src/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,7 @@ module.exports = [
'noParams': true,
'styles': {
'display': 'table-cell',
'width': '1600px', /* 1 */
'*width': 'auto',
'zoom': 1
'width': '1600px' /* 1 */
}
},
/**
Expand All @@ -164,9 +162,6 @@ module.exports = [
'link': 'https://acss.io/guides/helper-classes.html#-cf-clearfix-',
'matcher': 'Cf',
'noParams': true,
'styles': {
'zoom': 1
},
'rules': {
'.Cf:before, .Cf:after': {
'content': '" "',
Expand Down Expand Up @@ -224,7 +219,6 @@ module.exports = [
'noParams': true,
'styles': {
'position': 'absolute !important',
'*clip': 'rect(1px 1px 1px 1px)',
'clip': 'rect(1px,1px,1px,1px)',
'padding': '0 !important',
'border': '0 !important',
Expand All @@ -248,8 +242,6 @@ module.exports = [
'noParams': true,
'styles': {
'display': 'inline-block',
'*display': 'inline',
'zoom': 1,
'vertical-align': 'top'
}
},
Expand Down Expand Up @@ -283,9 +275,7 @@ module.exports = [
},
'a[class*=LineClamp]': {
'display': 'inline-block',
'display ': '-webkit-box',
'*display': 'inline',
'zoom': 1
'display ': '-webkit-box'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@thierryk @carriemorrison -webkit-box is a non standard thing, should we remove all references now?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-webkit-box is a non standard thing...

Is it? /s

6.1.1 Legacy Compatibility

UAs that support line-clamp must also support the -webkit-line-clamp

They made a mess when they introduced vendor prefixes. i.e., MS Edge supports line-clamp with -webkit- prefix, but not with -ms...

I'd leave things the way they are though as this original -webkit- way to do line-clamp was really a hack.
And also because for this to work, we are using -webkit-box-orient which is another prefixed property.

Better would be to revisit the styling/declarations in that "helper" class to use the new stuff now that we have line-clamp and other goodies...

},
/**
* Fix WebKit bug that displays ellipsis in middle of text inside *LINKS*
Expand Down Expand Up @@ -322,10 +312,7 @@ module.exports = [
'display': 'inline-block',
'vertical-align': 'top',
'width': '100%',
'box-sizing': 'border-box',
'*display': 'block',
'*width': 'auto',
'zoom': 1
'box-sizing': 'border-box'
}
},
/**
Expand All @@ -348,22 +335,5 @@ module.exports = [
'bottom': 0,
'left': 0
}
},
/**
==================================================================
Zoom
hack for oldIE to create a "block-formatting context"
==================================================================
*/
{
'type': 'helper',
'name': 'Zoom',
'description': "Gives a box 'layout' in old versions of Internet Explorer",
'link': 'https://acss.io/guides/helper-classes.html#-zoom-',
'matcher': 'Zoom',
'noParams': true,
'styles': {
'zoom': '1'
}
}
];
Loading